-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
This is a:
- Bug Report
- Feature Request
- Question
- Other
Which concerns:
- flow-runtime
- babel-plugin-flow-runtime
- flow-runtime-validators
- flow-runtime-mobx
- flow-config-parser
- The documentation website
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
menelike, tebuevd and jedwards1211
Metadata
Metadata
Assignees
Labels
No labels