After upgrading my React Native project using react-native-git-upgrade
I get the following error:
error: bundling failed: TypeError: Cannot read property 'bindings' of null
at Scope.moveBindingTo (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/scope/index.js:978:13)
at BlockScoping.updateScopeInfo (/Users/jan/Startup/react-native/ordersome/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
at BlockScoping.run (/Users/jan/Startup/react-native/ordersome/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
at PluginPass.BlockStatementSwitchStatementProgram (/Users/jan/Startup/react-native/ordersome/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
at newFn (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/visitors.js:237:21)
at NodePath._call (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/path/context.js:65:20)
at NodePath.call (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/path/context.js:100:12)
at TraversalContext.visitQueue (/Users/jan/Startup/react-native/ordersome/node_modules/@babel/traverse/lib/context.js:142:16)
It seems like this problem has something to do with babel. I restarted metro as well as my simulator, but that did not change a thing. Also here are all the packages I've installed that have anything to do with babel (package.json):
"babel-eslint": "^8.2.5",
"babel-jest": "23.2.0",
"babel-preset-react-native": "4.0.0",
And here is my .babelrc
:
{
"presets": ["react-native"]
}
I generated the project using react-native init
when it was still at 0.55.
Try to update the version forbabel-preset-react-native
in your package.json like so:
"babel-preset-react-native": "^5"
.
According the babel-preset-react-native entry on npmjs.org, it is obsolete. metro-react-native-babel-preset is the replacement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With