Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "does not exist in the Haste module map" for already installed packages. #379

Open
ziyoshams opened this issue Mar 21, 2019 · 8 comments

Comments

@ziyoshams
Copy link

Do you want to request a feature or report a bug?
Maybe a bug.

What is the current behavior?

error: bundling failed: Error: Unable to resolve module `@react-native-community/netinfo`  
 from `.../src/containers/Main.js`: Module `@react-native-community/netinfo` does not exist  
 in the Haste module map or in these directories: .../node_modules/@react-native-community

Please Note, this this error is not specific to netinfo. I also had the same issue with react-native-extra-dimensions-android.
What is the expected behavior?
Not throw error for already installed packages.

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Mac OS High Sierra
node: v10.14.1
npm: 6.5.0
react-native: 0.59.1

metro.config.js

const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
  resolver: {
    blacklistRE: blacklist([/nodejs-assets\/.*/, /android\/.*/, /ios\/.*/, /unity\/.*/])
  },
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false
      }
    })
  }
};

Following steps did not solve the issue:

  • remove node_modules and reinstalled.
  • ran react-native start --reset-cahce or npm start -- --reset-cache
  • removed haste-map* directories from '/tmp`
  • removed metro-bundler-cache-*
  • cleared watchman

Anyone else having the same issue?

@ziyoshams
Copy link
Author

I guess this is the reason

npm WARN @react-native-community/[email protected] requires a peer of react-native@>=0.57 <0.59 but none is installed. You must install peer dependencies yourself.

@erikrahm
Copy link

erikrahm commented Apr 8, 2019

Having this same issue when trying to use apollo-client, very frustrating

@EvertonCosmo
Copy link

same here with serialport https://github.com/node-serialport/node-serialport

: Module stream does not exist in the Haste module map

@idhindsight
Copy link

I guess this is the reason

npm WARN @react-native-community/[email protected] requires a peer of react-native@>=0.57 <0.59 but none is installed. You must install peer dependencies yourself.

Did you actually determine this was the root cause? Were you able to resolve it?

@ziyoshams
Copy link
Author

I guess this is the reason

npm WARN @react-native-community/[email protected] requires a peer of react-native@>=0.57 <0.59 but none is installed. You must install peer dependencies yourself.

Did you actually determine this was the root cause? Were you able to resolve it?

Unfortunately no. I upgraded the packages to their latest and it works again. Not sure what the issue is.

@jupmorenor
Copy link

Also experimenting the issue, i'm using nodejs-websocket and it has dependences from @types/node like net module, and they are already installed but it fails to find it.

@rochapablo
Copy link

#391 (comment)

@ssalexa
Copy link

ssalexa commented Dec 18, 2019

Same issue here. Looking for solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants