请帮助我理解为什么 bable/runtime/helpers 无法解析 interopRequireDefault。我刚刚升级了 babel,试图将我的依赖项显式移动到 babel 7.0.0。据我了解,如果我的 babelrc 文件中提供的“插件”没有检测到浏览器支持最新的 babel 使用。
错误是:模块构建失败:TypeError:无法读取 null 的属性“绑定”
我的 babel-loader 肯定是在调用文件并启动编译。我是否需要指定其他一些配置或遍历过程?
开发依赖
"devDependencies": {
"@babel/cli": "^7.0.0-beta.34",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.34",
"@babel/plugin-syntax-export-default-from": "7.0.0-beta.34",
"@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.34",
"@babel/plugin-transform-runtime": "^7.0.0-beta.34",
"@babel/plugin-transform-strict-mode": "7.0.0-beta.34",
"@babel/preset-react": "^7.0.0-beta.34",
babelrc
"presets": [
"latest",
"react",
],
"plugins": [
"@babel/plugin-syntax-export-default-from",
"@babel/plugin-syntax-export-namespace-from",
"@babel/plugin-transform-runtime",
"@babel/plugin-syntax-object-rest-spread",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-strict-mode",
],
呃
at Scope.moveBindingTo (/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:939:12)
at BlockScoping.updateScopeInfo (/node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
at BlockScoping.run (node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
at PluginPass.BlockStatementSwitchStatementProgram (node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)