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

Bundler claiming "Module does not exist in the module map" on fresh install of existing React Native project #161

Closed
willbattel opened this issue Apr 19, 2018 · 1 comment

Comments

@willbattel
Copy link

Do you want to request a feature or report a bug?
bug 🐛

What is the current behavior?
After installing dependencies, React Native build succeeds but Metro fails with this error.

Unable to resolve module `redux` from `path/to/node_modules/react-redux/lib/connect/mapDispatchToProps.js`: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
+ [[ false != true ]]
+ [[ ! -f /Users/wbattel4607/Library/Developer/Xcode/DerivedData/myapp-cvscqhbhrcowbrfzfirwmdiuyvfc/Build/Products/Release-iphoneos/myapp.app/main.jsbundle ]]
+ echo 'error: File /Users/wbattel4607/Library/Developer/Xcode/DerivedData/myapp-cvscqhbhrcowbrfzfirwmdiuyvfc/Build/Products/Release-iphoneos/myapp.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues'

We do not use redux in our project, so it is not in our package.json.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
I do not yet know how to consistently reproduce this.

What is the expected behavior?
Metro to not throw errors. Nothing in our project has changed since it was working. This issue started when I deleted my local copy of the project and re-cloned from our remote repo.

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

Environment:
  OS: macOS High Sierra 10.13.4
  Node: 6.10.3
  Yarn: 1.6.0
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.3 Build version 9E145
  Android Studio: 3.0 AI-171.4408382

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.3 => 0.55.3

I'm happy to provide any wanted information I may have left out.

This is the more detailed issue I raised on the React Native project, since the error specifically requested it. facebook/react-native#18931

@rafeca
Copy link
Contributor

rafeca commented Jun 3, 2018

Thanks for reporting @wbattel4607! This is probably caused by some third party npm package that you're using that requires redux but does not have it listed as a dependency in its package.json. I would suggest grepping for redux in your node_modules folder to find that package.

Hope that this helps :)

@rafeca rafeca closed this as completed Jun 3, 2018
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

2 participants