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.

"React Native version mismatch", but native and JS versions appear to match

See original GitHub issue

Steps to Reproduce

  1. XDE automatically upgrade to v2.24.3
  2. Run iOS simulator getting “React Native version mismatch” error JavaScript version: 0.52.0 Native version: 0.54.2
  3. run exp start -c is working fine able to launch the app without issue

Workaround: downgrade to v2.23.1 https://github.com/expo/xde/releases/tag/v2.23.1

Expected Behavior

should XDE upgrade automatically?

exp diagnostics 22:38:54 [exp] There is a new version of exp available (53.0.0). You are currently using exp 52.0.3 Run npm install -g exp to get the latest version 22:38:54 [exp] Generating diagnostics report… 22:38:54 [exp] You can join our slack here: https://slack.expo.io/.

Environment: OS: macOS Sierra 10.12.6 Node: 6.12.3 Yarn: 1.3.2 npm: 3.10.10 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => 16.2.0 react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0

Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/ken_commit-17d6c7e6-c5fd-47d0-9538-03b44945aab9.tar.gz

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sjchmielacommented, Nov 23, 2018

This error may only happen if, well, JS and native versions mismatch. Where do these versions come from?

Native React Native version comes from Expo SDK. Every release blog post contains information about which RN version does, eg. SDK31 is based on React Native 0.57 (source):

Expo SDK v31.0.0 is based on the recently released React Native 0.57 “September 2018”. The previous SDK release, v30.0.0, was based on React Native 0.55, “March 2018”.

JS React Native version comes, to be specific, from node_modules/react-native/package.json.

If the versions mismatch, it usually means sdkVersion in app.json points to an Expo SDK which uses different React Native than you have installed in your project.

Since we use a fork of react-native where we can apply Expo-specific patches and fixes and we want to help developers use Expo more easily, we encourage/require use of GitHub-tagged package as react-native dependency. URL to which you should point your react-native dependency is always stated in release notes, eg. (source):

In package.json, change these dependencies:

  • react-native to "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz"

All in all, if "react-native": "https://github.com/expo/react-native/archive/sdk-XX.0.0.tar.gz" in package.json matches the "sdkVersion": "XX.0.0" in app.json, this problem shouldn’t ever occur. 🙂 Sometimes to fix this issue, I believe, you’ll need to remove node_modules and install the dependencies again. I hope this explanation lets you reassure your project setup is correct and ready for development!

I’ll close this issue tentatively, this problem shouldn’t occur in recent versions of Expo SDK and Expo CLI.

0reactions
lock[bot]commented, Jun 13, 2019

This thread has been automatically 🔒locked🔒 since there has not been any recent activity after it was closed. Oftentimes the underlying causes of old issues and steps to reproduce them are different from those of new issues. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native version mismatch - Stack Overflow
The "JavaScript version 0.50.1" in the error console is the react-native version in your package.json file. Make sure it is the same version...
Read more >
React-native version mismatch 0.59.4 · Issue #24529 - GitHub
We are facing issue with react-native. I recently upgrade the version of react native from 0.57.3 to 0.59.4 (for different modules needs).
Read more >
How to fix React Native version mismatch - DEV Community ‍ ‍
To fix this just do the following. 1). Open package.json. 2). Change this line. "react-native": "^0.61.4",. to reflect the new version.
Read more >
Resolving React Native version mismatch errors
There exists an especially difficult RedBox error you'll encounter which reads: React Native version mismatch. JavaScript version: <x> ...
Read more >
Upgrading to new versions - React Native
Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies.
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