This is a:
Which concerns:
What is the current behaviour?
Example:
import type { Bar } from './types';
type Foo = {|
...Bar,
foobar: string,
|};
If a type is imported from external file and spread into another type the following error is thrown: TypeError: Invalid attempt to spread non-iterable instance.
It seems like that at this point the @babel/flow preset already stripped out the types so it tries to spread undefined.
But if both types are declared in the same file everything works fine.
To showcase this bug I created a minimal reproducible example over here: https://github.com/risetechnologies/flow-runtime-bug
What is the expected behaviour?
It should be possible to spread a type from external file into another type.
Which package versions are you using?
flow-runtime: 0.17.0
babel-plugin-flow-runtime: 0.19.0
This is a:
Which concerns:
What is the current behaviour?
Example:
If a
typeis imported from external file and spread into anothertypethe following error is thrown:TypeError: Invalid attempt to spread non-iterable instance.It seems like that at this point the
@babel/flowpreset already stripped out the types so it tries to spreadundefined.But if both types are declared in the same file everything works fine.
To showcase this bug I created a minimal reproducible example over here: https://github.com/risetechnologies/flow-runtime-bug
What is the expected behaviour?
It should be possible to spread a type from external file into another type.
Which package versions are you using?