react-native: Error loading up after upgrade to 0.43
Error loading up the app after upgrading to 0.43
After upgrading to 0.43 from 0.42.3 I get this error shown below. I have tried all suggestions from error message but none fixed the problem.
error: bundling: UnableToResolveError: Unable to resolve module react/lib/ReactComponentWithPureRenderMixin
from ../app/node_modules/react-navigation/src/views/Header.js
: Module does not exist in the module map or in these directories:
/app/node_modules/react/lib
This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following:
- Clear watchman watches:
watchman watch-del-all
. - Delete the
node_modules
folder:rm -rf node_modules && npm install
. - Reset packager cache:
rm -fr $TMPDIR/react-*
ornpm start --reset-cache
. at p.catch.error (/app/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:366:19) at process._tickCallback (internal/process/next_tick.js:109:7) Bundlingindex.android.js
99.2% (509/511), failed.
Please note that I have tried this in both Ubuntu 16.10 and Windows 10. This is how my package.json changed:
- “react”: “15.4.2”,
- “react-native”: “0.42.3”,
- “react”: “^16.0.0-alpha.6”,
- “react-native”: “^0.43.0”,
Reproduction Steps and Sample Code
I had NO conflicts during upgrade
I followed the suggested way to upgrade:
- npm install -g react-native-git-upgrade
- react-native-git-upgrade
- react-native start
- react-native run-android
Solution
I don’t have a solution. I have navigated in the folder in question and I can see that Header.js exists.
The only thing that I can think of is creating a new app and moving over my src/ to the new project. Obviously I don’t want to have to do that every time there is a new version.
Additional Information
- React Native version: [^0.43.0]
- Platform: [Android]
- Development Operating System: [Ubuntu 16.10, Windows 10]
- Dev tools: [IntelliJ IDEA Ultimate 2017.1, VSCode, Android SDK 23]
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 16 (2 by maintainers)
It seems odd to me that
0.43
, a stable version ofreact-native
, depends on a potentially unstable alpha version ofreact
@joemckie True, but:
This problem is due to the react version use “react”: “16.0.0-alpha.3”, is fine
I don’t understand your comment, how is that fine? Effectively the upgrade path to the newer version is broken. Is there a suggested solution?
Same issue here, change to “16.0.0-alpha.3” is fine, but i don’t think this is good solution. So, we hope facebook developer can be fix this bug, thanks!
@sherlock221 and how do u force it to use a older version, when using react-native init [project name] ?