【发布时间】:2018-12-13 04:09:47
【问题描述】:
使用 react-native-git-upgrade 升级我的 React Native 项目后,我收到以下错误:
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)
这个问题好像和babel有关。我重新启动了地铁以及我的模拟器,但这并没有改变任何事情。这里还有我安装的所有与 babel (package.json) 有关的包:
"babel-eslint": "^8.2.5",
"babel-jest": "23.2.0",
"babel-preset-react-native": "4.0.0",
这是我的.babelrc:
{
"presets": ["react-native"]
}
我使用react-native init 生成了项目,当时它还在 0.55。
【问题讨论】:
标签: reactjs react-native upgrade babeljs