React-native: Error loading up after upgrade to 0.43

Created on 5 Apr 2017  ·  16Comments  ·  Source: facebook/react-native

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:

  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.
    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)
    Bundling index.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:

  1. npm install -g react-native-git-upgrade
  2. react-native-git-upgrade
  3. react-native start
  4. 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]
Locked

Most helpful comment

It seems odd to me that 0.43, a stable version of react-native, depends on a potentially unstable alpha version of react

All 16 comments

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?

@sherlock221 and how do u force it to use a older version, when using react-native init [project name] ?

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!

So changing the version to that and

rm -rf nodes_modules/ && npm install

is the suggested solution? I will try to verify tomorrow.

Indeed that's​ not very viable but good enough for now.

@Kennytian same here, and agreed

In order to use the alpha version, you need to run:

rm -rf node_modules && npm install

Clean ios/android build folder:

rm -rf android/build && rm -rf ios/build

After that, just run as usual:

react-native run-ios or react-native run-android

It seems odd to me that 0.43, a stable version of react-native, depends on a potentially unstable alpha version of react

Agree. And some important packages like react-native-router-flux and react-native-maps use the latest stable React 15.4.2 and now incompatible with RN 0.43.1.

@mikehobi 0.43 is not a stable version unfortunately as it's still version 0.x.x

@joemckie True, but:

screen shot 2017-04-07 at 1 45 14 pm

Is there any official word on this? I upgraded to 43 to get past done 42 bugs, and now storyshots is
broken.
It seems like a pretty bad idea to upgrade to an alpha version of react. I think maybe I'll need to go to 41 instead.

react": "16.0.0-alpha.3" works for me .I have be under the problem for serval days!thank you! @sherlock221

👍 on using a stable version

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

Was this page helpful?
0 / 5 - 0 ratings