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

Metro "Unable to resolve module redux ... Module does not exist in the module map" but we don't use redux #18931

Closed
3 tasks done
willbattel opened this issue Apr 19, 2018 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@willbattel
Copy link

willbattel commented Apr 19, 2018

Environment

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

Steps to Reproduce

I'm not sure how this can be reproduced by others. This happened to me when I re-installed the remote project.

Expected Behavior

Project should run as it did before I deleted my local copy of the project.

Actual Behavior

  1. Cloned previously-working project from remote Git
  2. yarn install
  3. cd ios && pod install
  4. cd .. && react-native run-ios or, alternatively, Open Xcode, set to physical device, and run project.
  5. In final steps of the build (Bundle React Native code and images), Xcode 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'

I've tried the suggested steps, and tried using both NPM and Yarn to install our dependencies.

It says it can't resolve redux but our project does not use redux save for our packages' peer-dependencies. It also says false != true, suggesting there is a logic error somewhere in my bundled code, but nothing has changed since it was last working. Finally, it says it can't find main.jsbundle, and I've confirmed that it is not being included in the packaged build for whatever reason.

The log suggests I report it, suggestions in #4968 haven't helped, and I don't know how to fix it, so here I am!

@willbattel willbattel changed the title "Unable to resolve module redux ... Module does not exist in the module map" but we don't use redux Metro "Unable to resolve module redux ... Module does not exist in the module map" but we don't use redux Apr 19, 2018
@t3chnoboy
Copy link

t3chnoboy commented Apr 19, 2018

Installing redux resolved the issue for me 🤷‍♂️

@willbattel
Copy link
Author

willbattel commented Apr 19, 2018

@t3chnoboy yeah that fixes it for us too, but we shouldn't have to install it if it's only a peer dependency.

@thiszhong
Copy link

@wbattel4607 Same doubt. But it seems appeared after I used react-native-root-toast. Did you have a use?

@Pines-Cheng
Copy link

appeared after I used react-native-root-toast...

@willbattel
Copy link
Author

This isn't an issue with React Native, so I'm closing this issue.

@facebook facebook locked as resolved and limited conversation to collaborators Jun 27, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants