I recently added this to my flow config due to tons of errors related to node modules that flow picks up
[ignore]
.*/node_modules/.*
This solved those errors, but introduced new one. Now every module I import results in an error where flow says it can't resolve it, hence leading me to think this is due to that ignore rule I added.
Is there a way to fix this because here removing this line just introduces different kind of error, keeping it in still makes it error.
I recently added this to my flow config due to tons of errors related to node modules that flow picks up
[ignore]
.*/node_modules/.*
This solved those errors, but introduced new one. Now every module I import results in an error where flow says it can't resolve it, hence leading me to think this is due to that ignore rule I added.
Is there a way to fix this because here removing this line just introduces different kind of error, keeping it in still makes it error.
Share Improve this question edited Nov 14, 2017 at 18:35 Nat Mote 4,08619 silver badges30 bronze badges asked Oct 24, 2017 at 9:00 IljaIlja 46.5k103 gold badges289 silver badges527 bronze badges 2- 1 I have the same issue – alaboudi Commented Apr 15, 2018 at 23:05
- It's not supposed to cause this kind of error, is it possible that those dependencies are not actually in node_modules? – frontsideair Commented Apr 19, 2018 at 19:47
2 Answers
Reset to default 9It's a little late now, but for anyone stumbling along this question in the future: you shouldn't ignore your node_modules folder. Flow is supposed to read from that folder and analyze the files inside it.
Actually this is because of the module has no typed definitions. So we can just use flow-typed to create any definition.
Run
yarn global add flow-typed
to install flow-typed globally.Go to project folder:
flow-typed install
Close your terminal and try to run
npm run flow
again. That's it.
Ref: https://github./facebook/flow/issues/5935