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.

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

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:14
  • Comments:8

github_iconTop GitHub Comments

6reactions
ziyoshamscommented, Mar 26, 2019

I guess this is the reason

npm WARN @react-native-community/netinfo@1.4.0 requires a peer of react-native@>=0.57 <0.59 but none is installed. You must install peer dependencies yourself.
0reactions
ssalexacommented, Dec 18, 2019

Same issue here. Looking for solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module 'react-navigation' doesn't exist in the haste module map
I'm facing the problem as "react-navigation is not exist in the haste module map" eventhough I've installed "react-navigation" and ...
Read more >
Module doesn't exist in the Haste module map. : r/reactnative
Just run the packager command and start the app which is already installed on your device/simulator in the first instance. Most libraries are...
Read more >
"Module does not exist in the Haste module map" problem
I am building the iOS app with React Native(not with expo), and I get the error with the react-native-bip39 module installation. Since I...
Read more >
@carimus/metro-symlinked-deps - npm
The primary use case for this package is to support development on ... `your-symlinked-module` does not exist in the Haste module map This ......
Read more >
Module fs does not exist in the Haste module map
Moduledateformat does not exist in the Haste module map. and the fix was to explicitly add dateformat as a dependency. Previously it wasn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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