In my react native project if I run the bundling command, It fails with the mentioned error.
Command:
`sudo react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/`
Error:
error Unable to resolve module 'scheduler' from '/home/buddhi/Buddhi/my-dev-environment/html/react-apps/mobile-64/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-prod.js': Module 'scheduler' 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-*'.. Run CLI with --verbose flag for more details.
Versions:
When I run the same command with react-native 0.57.2 is runs perfectly. (Note that I need to use react native version 0.59.0 to get the android x64 architecture support for the application)
/node_modules and npm install again numerous times. npm start --reset-cache.Still the issue is there.
The change as I can see is that in react-native version 0.59.0 there is the line var scheduler = require("scheduler"), in the file ReactNativeRenderer-prod.js as mentioned in the error. But in react-native version 0.57.2 it is not used.
I'm pretty sure that this is caused by npm, not an issue of the react-native versions. Is it?
Can't figure out why it is not in the mentioned Haste Module Map, and what exactly is the Haste Module Map? I couldn't find enough information to support the issue.
Any help appreciated. Ask for additional information.
If you are using expo, then make sure that your expo and react-native versions are the following:
"expo": "^35.0.0",
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
Only this combination worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With