question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve module: createReactNativeComponentClass from react-native-svg/elements/Rect.js

See original GitHub issue

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)

  1. Run create-react-native-app test in Terminal
  2. Open package.json, then add the dependencies on 1, then save
  3. Run rm -rf node_modules && npm install
  4. Run npm start
  5. Open App in Expo with barcode, the js bundle created, got error
  6. Ctrl + C to terminate packager process
  7. Run npm run android to deploy directly to device
  8. 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:closed
  • Created 6 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
trickeydcommented, Sep 3, 2017

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!

0reactions
shivrajkumarcommented, Sep 11, 2017
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found