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.
It'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.com/facebook/flow/issues/5935
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With