Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Required module not found" for module that exists in node_modules

Tags:

flowtype

Some modules just seem to be invisible to Flow. For example I have react-native-overlay installed via npm into my node_modules directory but I get a whole bunch of errors like this from Flow:

[js/components/DatePickerOverlay.js:18
 18: let Overlay = require('react-native-overlay');
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ react-native-overlay. Required module not found

This module doesn't have types so it would be fine if I could just get Flow to ignore it entirely.

Here's my .flowconfig (based on React Native's one):

https://gist.github.com/almost/20c6caf6d18d0e5c689f

As you can see I'm on flow 0.20.1 and I have module.system=haste (as required by React Native)

I tried adding a //$FlowIgnore comment to the import lines but then Flow complains about an unneeded ignore comment! I also tried creating a react-native-flow.js.flow file with a dummy export which seemed to work at first but then after a flow restart stopped working.

Any ideas for how to either help Flow find this module or make it ignore the import line completely?

like image 222
Thomas Parslow Avatar asked Apr 18 '26 08:04

Thomas Parslow


1 Answers

Looks like you're ignoring it here: https://gist.github.com/almost/20c6caf6d18d0e5c689f#file-flowconfig-L42-L50

If you don't mind manually typing it up, add a react-native-overlay.js to your interfaces and type up a couple signatures.

like image 111
kakigoori Avatar answered Apr 23 '26 10:04

kakigoori



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!