GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.
https://nativebase.io/
MIT License
20.21k stars 2.39k forks source link

Unable to resolve module `react-native/Libraries/Renderer/shims/ReactNativePropRegistry` from `........./node_modules/native-base/dist/src/Utils/computeProps.js` #1039

Closed ckim16 closed 7 years ago

ckim16 commented 7 years ago

Hi all,

I'm currently using "native-base": "^2.2.1" and "react-native": "^0.44.3" and I get an error saying

Unable to resolve module react-native/Libraries/Renderer/shims/ReactNativePropRegistry from path/to/node_modules/native-base/dist/src/Utils/computeProps.js.

I believe this is a version issue and but not sure this is a native-base's issue or react-native's issue.

Has anyone had same problem before?

Hamid-Najafi commented 7 years ago

i had this problem too in 0.42.0 after upgrading to 0.46.1 i have a new one ! /================================================/ Bundling index.android.js 97.7% (1221/1235), failed. error: bundling failed: "Unable to resolve module react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass from C:\\Users\\Hamid\\Documents\\ReactXP\\Samples\\hello-world\\node_modules\\react-native-svg\\elements\\Rect.js: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache."

thinq4yourself commented 7 years ago

👍 - We are also seeing this issue:

"native-base": "^2.1.5", "react": "16.0.0-alpha.12", "react-native": "0.45.1",

I can add more info if required

Nahueleti commented 7 years ago

Same error as @ckim16 env:

"react-native": "^0.46.1",
"native-base": "2.1.5",
Maxeh commented 7 years ago

👍 - We are also seeing this issue: "native-base": "^2.1.5", "react": "16.0.0-alpha.12", "react-native": "0.45.1",

@thinq4yourself seems to be a problem with native-base 2.2.1. Just remove the "^" and choose version 2.2.0. Delete everything and execute "npm install" again. It should work then, it took me almost an hour to find the reason for this bug.

I'm also using RN 0.45.1

Nahueleti commented 7 years ago

@Maxeh confirmed working, thanks!

ckim16 commented 7 years ago

I upgraded react-native to 0.46.1 and it seems to be working fine. I'm not sure what just happened.

Hamid-Najafi commented 7 years ago

@ckim16 but im getting this error and i dont know why !

Sent from my Samsung SM-N920C using FastHub

ckim16 commented 7 years ago

@Goldenstarc Wish I really can explain what just happened with mine but I'm afraid. All I did for last hour or longer was trying different version of NB and RN and remove node_modules, re-install, clean up Xcode, and so on.. Finally it worked with"native-base": "^2.2.1", "react-native": "^0.46.1" and "react": "^16.0.0-alpha.12". Honestly tho, I'm not sure it will keep working fine once I stop the task now and re-build after couple hours.

shivrajkumar commented 7 years ago

@ckim16 @Goldenstarc #307

AndsteLyc commented 7 years ago

@Maxeh confirmed working, thanks!

yukkeechang commented 7 years ago

I'm also: "native-base": "^2.1.5", "react": "16.0.0-alpha.12", "react-native": "0.45.1", and it happens to me too. I just go into computeProps.js and change the import statement to: "react-native/Libraries/Renderer/src/renderers/native/ReactNativePropRegistry" and it works however, sometimes when i re open the project, it reverts back to the old import which throws me this error. i think this may be because i delete all my modules then reinstall (for the weird errors i get when i try to install other modules). But anyways, does anyone knows why this happens? I check the compatibility in NB docs and it's okay.

trankhacvy commented 7 years ago

"native-base": "^2.2.1", "react": "16.0.0-alpha.12", "react-native": "^0.45.1",

I'm also. I create a project with CRNA, install native-base and run ok. Then i create another project and copy list dependencies from old project paste to new project, run yarn install and start. It's not woking. I don't know why !!!!!!

ghhamza commented 7 years ago

I think using NB for enterprise project it's very dangerous, I have this kind of errors every time I'm trying to upgrade or change a npm module :( And I'm losing many hours for that !

Pluue commented 7 years ago

@Levi-ackerman I think that is because NB v2.2.1 is for react-native v0.46.0 and up according to this thread https://github.com/GeekyAnts/NativeBase/issues/1021

"native-base": "^2.2.0", "react": "16.0.0-alpha.12", "react-native": "^0.46.0"

And I'm still getting this issue, using CRNA. Weird.

ghhamza commented 7 years ago

I tried all the possible combinations ...

lionel95200x commented 7 years ago

Me too @ghhamza and it's doesn't work, do you have any solutions ?

alihaghani commented 7 years ago

I'm also having this issue. Tried the combinations above with no success.

sankhadeeproy007 commented 7 years ago

@Pluue @ghhamza @lionel95200x @AliHaghani If RN 0.46 and native-base 2.2.1 isn't working for you, can you please post your package.json?

ghhamza commented 7 years ago

@sankhadeeproy007

"dependencies": { "axios": "^0.16.2", "expo": "^18.0.4", "firebase": "^4.1.3", "native-base": "^2.2.1", "react": "16.0.0-alpha.12", "react-native": "0.45.0", "react-native-action-button": "^2.7.2", "react-native-autocomplete-input": "^3.3.1", "react-native-navbar": "^1.7.1", "react-native-vector-icons": "^4.2.0", "react-navigation": "^1.0.0-beta.11", "react-redux": "^5.0.5", "redux": "^3.7.2", "redux-persist": "^4.8.2", "redux-thunk": "^2.2.0" }

lionel95200x commented 7 years ago

@sankhadeeproy007 Me I have the same error than @Goldenstarc

Unable to resolve module react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass from '/project/myProject/react-native-svg/elements/Rect.js

Here it's my package.json 👍

"dependencies": { "expo": "^17.0.0", "firebase": "^4.1.3", "geofire": "^4.1.2", "lodash": "^4.17.4", "lottie-react-native": "^1.1.1", "moment": "^2.18.1", "native-base": "2.2.1", "prop-types": "^15.5.10", "react": "16.0.0-alpha.6", "react-native": "^0.46.0", "react-native-gifted-chat": "^0.1.4", "react-native-material-kit": "^0.4.1", "react-native-multislider": "0.0.14", "react-native-swiper": "^1.5.4", "react-navigation": "^1.0.0-beta.11", "react-redux": "^5.0.5", "redux": "^3.7.1", "redux-thunk": "^2.2.0" }

sankhadeeproy007 commented 7 years ago

@ghhamza Use this instead

"axios": "^0.16.2",
"expo": "^18.0.4",
"firebase": "^4.1.3",
"native-base": "2.2.0",
"react": "16.0.0-alpha.12",
"react-native": "0.45.0",
"react-native-action-button": "^2.7.2",
"react-native-autocomplete-input": "^3.3.1",
"react-native-navbar": "^1.7.1",
"react-native-vector-icons": "^4.2.0",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-persist": "^4.8.2",
"redux-thunk": "^2.2.0"
sankhadeeproy007 commented 7 years ago

@lionel95200x Does your project run without native-base? It looks like it is searching for react-native-svg.

lionel95200x commented 7 years ago

@sankhadeeproy007 I have the same error without native base

alihaghani commented 7 years ago

@sankhadeeproy007 That worked for me, thanks.

ghhamza commented 7 years ago

@sankhadeeproy007 it works now thanks !!

SupriyaKalghatgi commented 7 years ago

react-native-svg #360

Pluue commented 7 years ago

@sankhadeeproy007

Sorry for the delay, here's my dependencies in package.json: (I used CRNA)

`"dependencies": {

"@expo/vector-icons": "^5.0.0",

"expo": "^18.0.3",

"native-base": "^2.2.0",

"react": "16.0.0-alpha.12",

"react-native": "^0.46.0"

} }`

thien-thach commented 7 years ago

@Maxeh it worked, thanks

sreejipv commented 7 years ago

I'm also having this issue. "native-base": "^0.5.18" "react-native": "^0.38.1"

screen shot 2017-07-25 at 8 07 00 pm

mrcaobin commented 7 years ago

"native-base": "2.1.5", "react": "16.0.0-alpha.6", "react-native": "0.44.3", "react-native-vector-icons": "^4.3.0"

I use this and works fine.

dx51job commented 7 years ago

Thanks, guys! Indeed, it is a version issue for native-base. In fact, We just need to config the compatible version for native-base. Here is the solution:

  1. check "Compatibility Versions" https://github.com/GeekyAnts/NativeBase#6-compatibility-versions
  2. modify "native-base" version in package.json
    For example, in my package.json, "react-native": "0.44.3", so I modify native-base version for compatibility. "native-base": "2.2.0" (Remember ,don't add ^ or ~ symbol before version number !)
  3. delete "native-base" folder in your node_modules
  4. reinstall and it works fine! npm install native-base --save react-native link
jose2007kj commented 7 years ago

"native-base": "2.2.0", got me working thanks @sankhadeeproy007

seyyed-sina commented 7 years ago

it worked, tanx to @Maxeh

ztss0056 commented 5 years ago

Hello Currently I am using "native-base": "^2.2.1", "react-native": "^0.59.1",

I am getting following error error: bundling failed: Error: Unable to resolve module react-native/Libraries/Renderer/shims/ReactNativePropRegistry from path\node_modules\native-base\dist\src\Utils\computeProps.js: Module react-native/Libraries/Renderer/shims/ReactNativePropRegistry does not exist in the Haste module map

Please help me in this..

alihbk commented 4 years ago

Hello Currently I am using "native-base": "^2.2.1", "react-native": "^0.59.1",

I am getting following error error: bundling failed: Error: Unable to resolve module react-native/Libraries/Renderer/shims/ReactNativePropRegistry from path\node_modules\native-base\dist\src\Utils\computeProps.js: Module react-native/Libraries/Renderer/shims/ReactNativePropRegistry does not exist in the Haste module map

Please help me in this..

i have the same issue