react-native: After upgrading to react-native@0.55.3: Module `PickerIOS` does not exist in the Haste module map

I upgraded react-native from version 0.54.2 to latest 0.55.3. After that when i run react-native run-ios i get the following from the Metro bundler:

error: bundling failed: Error: Unable to resolve module `PickerIOS` from `/Users/sebbe/code/pitchler-app/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module `PickerIOS` does not exist in the Haste 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-*`.
    at ModuleResolver.resolveDependency (/Users/sebbe/code/pitchler-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:161:1460)
    at ResolutionRequest.resolveDependency (/Users/sebbe/code/pitchler-app/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:91:16)
    at DependencyGraph.resolveDependency (/Users/sebbe/code/pitchler-app/node_modules/metro/src/node-haste/DependencyGraph.js:272:4579)
    at dependencies.map.relativePath (/Users/sebbe/code/pitchler-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:376:19)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/sebbe/code/pitchler-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:374:16)
    at /Users/sebbe/code/pitchler-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:212:33
    at Generator.next (<anonymous>)
    at step (/Users/sebbe/code/pitchler-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:313)
    at /Users/sebbe/code/pitchler-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:473

I tried following the steps in the output: clear watchman watches, delete node_modules and the Metro Bundler cache but it did not work.

I removed node_modules and clear caches again. After that i installed the previous version i had of react-native again (0.54.2) and ran react-native run-ios again and it worked just fine.

Environment

Environment: OS: macOS High Sierra 10.13.4 Node: 9.5.0 Yarn: 1.5.1 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.3 Build version 9E145 Android Studio: 3.1 AI-173.4697961

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

Steps to Reproduce

Using react-native 55.3, try including PickerIOS and use it in the code. Then try to build it using react-native run-ios

Expected Behavior

The Metro Bundler should not give any errors and build the app.

Actual Behavior

The Metro Bundler terminal window gave me the error stated above.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 17
  • Comments: 17 (1 by maintainers)

Most upvoted comments

Ran into this also, I had to use yarn start --reset-cache when running the bundler till it actually cleared that error for me

I’m using npm 5.6.0 and just hit the same issue with RN 0.55.2. Upgrading to 0.55.4 and clearing everything with watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache fixed it for me.

Same here. @Slessi 's solution didn’t work:

Working on 0.55.4

  • yarn start --reset-cache or npm start --reset-cache
  • and press or execute ‘Reload JS’
  • wait until load at 100%

@srameshr rm -rf $TMPDIR/react-* && was what I removed, so it looked like:

watchman watch-del-all && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache

This above solution by @EdgarXolop does not work for me either. I am on exactly the same stack as @Spetastian.

Edit: it actually worked for me with the yarn command, but not with the npm command. Shouldn’t that be the same?

I have same problem! any solutions ?

Not working on 0.55.4 either