question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPM modules being preferred over Haste modules

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
idecommented, Jul 18, 2017

jest-haste-map 20.0.5 appears to be working fine in several of our projects including a test suite.

0reactions
jeanlauliaccommented, Aug 17, 2017

Looks like we’re good to close. Feel free to reopen if you still observe problems!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module Resolution | Metro - Meta Open Source
Module resolution is the process of translating module names to module paths at build time. For example, if your project contains the code:...
Read more >
About packages and modules - npm Docs
About modules​​ A module is any file or directory in the node_modules directory that can be loaded by the Node. js require() function....
Read more >
easy-hastebin - npm Package Health Analysis | Snyk
Simple NPM module for generating hasteb.in links. Motivation. I prefer hasteb.in to hastebin.com and I didn't like the fact that other modules used...
Read more >
Error: Unable to resolve module `react-native-gesture-handler`
In my case react-native-gesture-handler was installed but I uninstalled it and re-installed again. 1: uninstall npm uninstall react-native- ...
Read more >
You.i React Native Issues - You.i TV Developer Portal
i Platform Node Incompatible With the Installed Module. yarn global add youi-cli or yarn global upgrade youi-cli gives the following error on Linux:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found