upgrade to react native 0.57 throws error
See original GitHub issueEnvironment
React Native Environment Info:
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Memory: 4.52 GB / 15.91 GB
Binaries:
Yarn: 1.5.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.3.0 - C:\Program Files\nodejs\npm.CMD
Description
I upgraded from react-naitve 0.55.4 to react-native 0.57.0 and I get this error bundling failed: Error: The ‘decorators’ plugin requires a ‘decoratorsBeforeExport’ option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the ‘decorators-legacy’ plugin instead of ‘decorators’.
my package .json
`{
"name": "APP_PROJECTXXX",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"appcenter": "^1.8.1",
"appcenter-analytics": "^1.8.1",
"appcenter-crashes": "^1.8.1",
"lodash": "^4.17.10",
"mobx-react-navigation-store": "^1.4.4",
"moment": "^2.22.2",
"react": "16.5.0",
"react-native": "^0.57.0",
"react-native-config": "^0.11.5",
"react-native-confirmation-code-input": "^1.0.4",
"react-native-datepicker": "^1.7.2",
"react-native-device-info": "^0.22.5",
"react-native-iphone-x-helper": "^1.1.0",
"react-native-map-link": "^2.1.0",
"react-native-onesignal": "^3.2.6",
"react-native-vector-icons": "^5.0.0",
"react-navigation": "^1.0.0-beta.21"
},
"devDependencies": {
"babel-eslint": "^8.2.3",
"babel-jest": "22.4.3",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "4.0.0",
"eslint": "^4.19.1",
"eslint-plugin-react": "^7.7.0",
"jest": "22.4.3",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native",
"setupFiles": [
"<rootDir>\\node_modules\\appcenter\\test\\AppCenterMock.js",
"<rootDir>\\node_modules\\appcenter-analytics\\test\\AppCenterAnalyticsMock.js",
"<rootDir>\\node_modules\\appcenter-crashes\\test\\AppCenterCrashesMock.js"
]
}
}
`
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top Results From Across the Web
How to upgrade to React Native 0.57.0 version?
Run react-native upgrade and run the project. If it's not working , install that module manually. npm install create-react-class.
Read more >Upgrading to new versions - React Native
1. Run the upgrade command · 2. Resolve the conflicts.
Read more >react-native-video - npm
React Native 0.57 defaults to Gradle 3 & SDK 27. If you need to support an older React Native version, you should use...
Read more >How to Upgrade to React 18
In this post, we will guide you through the steps for upgrading to React 18. Please report any issues you encounter while upgrading...
Read more >[Solved]-Upgrading React native from 0.57 to 0.58.5-React ...
How can I determine if my React Native app is a debug or release build from JavaScript code? React Native error: "Could not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is what I did to fix the issue; I hope it can help someone else!
First install the new proposal decorators with
npm install @babel/plugin-proposal-decorators --save-dev
oryarn add @babel/plugin-proposal-decorators --dev
Then, inside of your
.babelrc
file, change this:To this:
EDIT:
After you’ve updated your
.babelrc
file, make sure to addpreset-flow
as well with the commandyarn add @babel/preset-flow --dev
ornpm install @babel/preset-flow --save-dev
Thanks @dileepbolisetti!
I’ve just updated to react-native 0.57 and got the same error. I tried all that is mentioned above (tried the babel upgrade tool on the link https://github.com/babel/babel-upgrade also tried @spiritman110 solution, but I’m still getting the same error.
This is my updated package.json file:
and this is my updated .babelrc file:
I deleted node modules and used yarn to install.
yarn -v 1.12.1 node -v 11.0.0 npm -v 6.4.1
Can anyone tell me what am I missing here? Any help would be appreciated.