NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

React Native 0.38.0-rc.0 - Unable to resolve module react/lib/ReactNativePropRegistry from /project/node_modules/native-base/Components/Widgets/Button.js

Open booboothefool opened this issue 10 years ago • 16 comments

Tried upgrading to React Native 0.37.0 and got this error: https://github.com/facebook/react-native/issues/11004

Upgraded to React Native 0.38.0-rc.0and got past that error, now getting error from Native Base:

Unable to resolve module react/lib/ReactNativePropRegistry from /project/node_modules/native-base/Components/Widgets/Button.js
    "native-base": "0.5.15",
    "react": "15.4.0",
    "react-native": "0.38.0-rc.0",

EDIT:

    "native-base": "0.5.15",
    "react": "15.3.2",
    "react-dom": "15.3.2",
    "react-native": "0.37.0",

Works for me.

booboothefool avatar Nov 19 '16 00:11 booboothefool

Hi, can I check with you:

  1. It is still incompatible with latest react v15.4.0, so either React or Nativebase has to fix it, right? Should not we leave the issue open?

  2. Is ReactDOM needed ?

Thank you. Cheers

donszek avatar Nov 24 '16 09:11 donszek

@tzyhhaur I reopened it for you. I believe React DOM is needed: https://facebook.github.io/react/blog/2016/11/16/react-v15.4.0.html#separating-react-and-react-dom

booboothefool avatar Nov 24 '16 23:11 booboothefool

Getting this error as well with react-native 0.38.

ujwal-setlur avatar Nov 26 '16 17:11 ujwal-setlur

Actually, the following work:

import { ReactNativePropRegistry } from 'react-native';

OR

var ReactNativePropRegistry = require{'react-native'};

So, it seems that ReactNativePropRegistry is indeed publicly exposed now, but it should not be referenced with an absolute path.

This needs to be fixed in:

NativeBase Components/Widgets/Button.js Utils/computeProps.js

react-native-easy-grid Utils/computeProps.js

ujwal-setlur avatar Nov 27 '16 03:11 ujwal-setlur

Fixed with latest release 0.5.18

SupriyaKalghatgi avatar Nov 29 '16 13:11 SupriyaKalghatgi

@SupriyaKalghatgi im using this version : "native-base": " 0.5.18", "react": "15.3.2", "react-native": "0.35.0", and its still the same.

minamakhtar avatar Dec 01 '16 05:12 minamakhtar

@thundenilla Please make sure of package versions

  • If you want to work with RN < 0.38 then you should go for NB < 0.5.16
  • For RN >= 0.38, NB 0.5.18 is compatible

#336

SupriyaKalghatgi avatar Dec 01 '16 08:12 SupriyaKalghatgi

this is still happening right now "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.45.1" }

Solitaryo avatar Jul 12 '17 09:07 Solitaryo

@Solitaryo Please check this

shivrajkumar avatar Jul 12 '17 09:07 shivrajkumar

I get the same error just like Solitaryo , i check the link still can't figure it out . Can you explain why , shivrajkumar. That would be appreciated.

motogod avatar Jul 12 '17 09:07 motogod

Hey , try to remove "native-base": "^2.2.1", npm uninstall --save native-base and reinstall 2.2.0

npm install --save [email protected]

It can solve the issue for now.

motogod avatar Jul 12 '17 09:07 motogod

@monodop RN keeps changing the path of ReactNativePropRegistry. They changed the path in RN 0.38.x and again now its changed in RN 0.46.x. It is an internal API, so it has to be imported from absolute path. Thus NativeBase v2.2.1 has been updated with the new path which works for RN 46. For RN < 46, go for NativeBase 2.2.0

shivrajkumar avatar Jul 12 '17 09:07 shivrajkumar

Now i know what's going on , thanks shivrajkumar

motogod avatar Jul 12 '17 10:07 motogod

@shivrajkumar I came to this issue from another ReactNativePropRegistry issue which was basically, my computeProps.js would change the import path (from "react-native/Libraries/Renderer/src/renderers/native/ReactNativePropRegistry" to 'react-native/libraries/Renderer/shims/ReactNativePropRegistry)would you be able to explain why even if i have the compatabilities "native-base": "^2.1.5", and "react-native": "^0.44.0", and after I change the incorrect path back to the original path that the error still pops up sometimes when I re run the project? This also happens to me with another module and it keeps happening and its so extremely frustrating

yukkeechang avatar Jul 14 '17 17:07 yukkeechang

@shivrajkumar , can you update the dependencies so the wrong version of native-base doesn't get installed with the wrong version of react-native? All I do is "yarn add native-base", and it doesn't properly update the react-native to the version needed. Manually downgrading/upgrading (ignoring what the dependencies handle) isn't a solution.

tmaly1980 avatar Jul 15 '17 01:07 tmaly1980

Can you please update the docs: https://docs.nativebase.io/docs/GetStarted.html

j2l avatar Jul 20 '17 14:07 j2l