NPM modules being preferred over Haste modules
See original GitHub issueI’ve debugged https://github.com/facebook/react-native/issues/13765#issuecomment-312557021 down to an issue where RN’s var merge = require('merge')
will import node_modules/merge
, instead of the expected react-native/Libraries/vendor/core/merge.js
(which contains a @providesModule merge
directive).
According to the dozens of users affected, it seems to be non-deterministic behavior that sometimes resolves itself with reinstallation, different versions of node, or recreation of the directory and node_modules directory. I’m not yet sure if this nondeterminisim is a bug in React-Native library code layout, or a bug in the RN packager (aka metro-bundler?) itself…but I’m leaning towards the latter, since it seems to violate my expectations for Haste module imports.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:18 (8 by maintainers)
Top GitHub Comments
jest-haste-map 20.0.5 appears to be working fine in several of our projects including a test suite.
Looks like we’re good to close. Feel free to reopen if you still observe problems!