NativeBase: Unable to resolve module: createReactNativeComponentClass from react-native-svg/elements/Rect.js
I 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 testin 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 androidto 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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (3 by maintainers)
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!