Unable to resolve module: createReactNativeComponentClass from react-native-svg/elements/Rect.js
See original GitHub issueI tried to use Native-base 2.2.1 with react-native 0.46.0, according to 2.2.1 release
But unfortunately when start the packager and run on device. It’s fail and show error I don’t see before.
react-native, react and native-base version
"dependencies": {
"native-base": "2.2.1",
"react": "16.0.0-alpha.12",
"react-native": "0.46.0",
"react-navigation": "^1.0.0-beta.11"
}
Expected behaviour
Application should just run and show UI on device
Actual behaviour
After JavaScript bundle finished got following log in terminal
2:48:41 PM: Failed building JavaScript bundle
2:48:41 PM: Restarted watchman.
Got following error message in both platforms
###iOS:
Unable to resolve module `react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass` from `/Users/teerasejjiraphatchandej/Desktop/React Native/login-form/node_modules/react-native-svg/elements/Rect.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 packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
ABI18_0_0RCTFatal
ABI18_0_0RCTSetFatalHandler
ABI18_0_0RCTSetFatalHandler
<redacted>
<redacted>
_dispatch_main_queue_callback_4CF
<redacted>
<redacted>
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
Exponent
<redacted>
Steps to reproduce (code snippet or screenshot)
- Run
create-react-native-app test
in Terminal - Open package.json, then add the dependencies on 1, then save
- Run
rm -rf node_modules && npm install
- Run
npm start
- Open App in Expo with barcode, the js bundle created, got error
- Ctrl + C to terminate packager process
- Run
npm run android
to deploy directly to device - Got error
Screenshot of emulator/device
Is the bug present in both ios and android or in any one of them?
Both iOS and Android got quite different message, but pointed to same origin, as you can see in screenshot
Any other additional info which would help us debug the issue quicker.
The error shows up when use following dependencies:
"dependencies": {
"@expo/vector-icons": "^5.0.0",
"expo": "^18.0.3",
"native-base": "2.2.1",
"react": "16.0.0-alpha.12",
"react-native": "0.46.0",
"react-navigation": "^1.0.0-beta.11"
}
But not if I use previous version of react, react-native, and native-base:
"dependencies": {
"@expo/vector-icons": "^5.0.0",
"expo": "^18.0.3",
"native-base": "2.1.4",
"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-navigation": "^1.0.0-beta.11",
"util" : "*"
}
I tried both create a fresh project and also with suggestion
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
But no luck.
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (3 by maintainers)
Top Results From Across the Web
unable to resolve module react-native-elements - You.com
Keep getting "Unable to resolve module" in react native ... to resolve module: createReactNativeComponentClass from react-native-svg/elements/Rect.js #1030.
Read more >Unable to Resolve Module in React Native App - Stack Overflow
Based on your folder structure, try import like this in index.js: ... Make sure the module is defined in the package.json use npm...
Read more >How do I fix unable to resolve a module in react native?
React Native, Typescript and VS Code: Unable to resolve module ... from '/project/myProject/react-native-svg/elements/Rect.js Here it's my ...
Read more >Error: Unable to resolve module `util` – Split Help Center
Running bundle using React Native and Javascript SDK causes an error. Bundling failed: Error: Unable to resolve module `util`.
Read more >MongoDB Atlas App Services & Realm
Fresh Setup: Realm React Native Error: Unable to resolve module `./subscription` from `node_modules/realm/lib/browser/index.js` · XCode 11.3.1 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did anyone manage to resolve this? I reinstalled all my dependencies today and hit this totally out of the blue!
I’ve tried everything mentioned so far here, but no joy.
Would really appreciate it if someone could post a list of working/fixed dependencies.
Thanks!
We do have the compatibility table here https://github.com/GeekyAnts/NativeBase#6-compatibility-versions