[英]Module build failed: TypeError: The plugin "transform-runtime" didn't export a Plugin instance
Using Babel with Webpack and trying to get generators to work in some react code.在 Webpack 中使用 Babel 并尝试让生成器在一些 React 代码中工作。 Attempting to use
babel-runtime
and babel-plugin-transform-runtime
to enable the use of ES6 generators but I'm getting the following error message when I fire up my local dev server:尝试使用
babel-runtime
和babel-plugin-transform-runtime
来启用 ES6 生成器的使用,但是当我启动本地开发服务器时收到以下错误消息:
Module build failed: TypeError: The plugin "transform-runtime" didn't export a Plugin instance
My package.json
includes the following我的
package.json
包括以下内容
"dependencies": {
...
"babel-core": "5.8.38",
"babel-loader": "5.0.0",
"babel-plugin-transform-runtime": "6.15.0",
"babel-preset-es2015": "6.14.0",
"babel-preset-react": "6.11.1",
"babel-preset-stage-2": "6.11.0",
"babel-runtime": "6.11.6",
...
}
My webpack.config.js
includes the following我的
webpack.config.js
包括以下内容
module: {
loaders: [
{
...
loader: 'babel-loader',
query: {
plugins: ['transform-runtime']
}
},
...
}
Any ideas as to what I'm doing wrong?关于我做错了什么的任何想法?
"babel-runtime": "6.11.6",
vs对比
"babel-core": "5.8.38",
Your versions don't match up.你的版本不匹配。 Since most of your deps are Babel 6, you should be using
babel-core@6
, same for babel-loader
.由于你的大部分 deps 都是 Babel 6,你应该使用
babel-core@6
,同样的babel-loader
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.