-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to react native 0.57 throws error #21320
Comments
Notice that RN0.57 uses babel 7. You need to do some migration stuff using babel-upgrade tool. |
hey, what do you mean legacy in babel.rc? can you show me example what to do please? I stuck for some hours |
could u show me your babel.rc file? Also, you need to use metro-react-native-babel-preset instead of react-native in preset config. See the description https://www.npmjs.com/package/babel-preset-react-native |
my babel.rc |
@adirzoari Try to use https://github.com/babel/babel-upgrade to migrate to babel 7. It will do everything for u. |
We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on Stack Overflow, or on Reactiflux. You may also use discuss.reactjs.org/ to discuss best practices. |
@adirzoari do you solve this issue? i have same an issue |
yes. my problem was that I removed node_modules and then installed with npm and not in yarn. so I deleted package_lock.json and install with yarn install |
Here is what I did to fix the issue; I hope it can help someone else! First install the new proposal decorators with Then, inside of your {
"presets": ["react-native"],
"plugins": ["transform-decorators-legacy"]
} To this: {
"presets": [
"module:metro-react-native-babel-preset",
"@babel/preset-flow"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy" : true }]
]
} EDIT: After you've updated your Thanks @dileepbolisetti! |
@spiritman110 i had to run "yarn add@babel/preset-flow" after the steps you mentioned. (y) |
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 Can anyone tell me what am I missing here? Any help would be appreciated. |
@ahmdsdk you need to download metro-react-native-babel-preset npm i metro-react-native-babel-preset |
Environment
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
`
The text was updated successfully, but these errors were encountered: