简体   繁体   English

模块构建失败:TypeError:插件“transform-runtime”没有导出插件实例

[英]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-runtimebabel-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.

相关问题 Babel插件“transform-runtime”仅在首次编译后才有效 - Babel plugin “transform-runtime” only works after first compile Babel 6转换运行时:$ export不是函数 - Babel 6 transform-runtime: $export is not a function 添加@babel/transform-runtime 插件时无法读取未定义的属性“Reactstrap” - Cannot read property 'Reactstrap' of undefined When adding @babel/transform-runtime plugin 在“ Users \\\\ PhpstormProjects \\\\ easy-essay \\\\。babelrc”中指定的未知插件“ transform-runtime” - Unknown plugin “transform-runtime” specified in "Users\\PhpstormProjects\\easy-essay\\.babelrc Webpack 4 + Babel 7转换运行时-无效的配置对象 - Webpack 4 + Babel 7 transform-runtime - Invalid configuration object plugin-transform-es2015-modules-commonjs没有遵循代码顺序 - plugin-transform-es2015-modules-commonjs didn't follow code order 模块构建失败:ReferenceError:在“ base”中将0指定为未知插件“ import” - Module build failed: ReferenceError: Unknown plugin “import” specified in “base” at 0 无限滚动jQuery插件不起作用 - Infinite scroll jquery plugin didn't work Webpack babel-loader 运行时:模块构建失败:TypeError:this.setDynamic 不是函数 - Webpack babel-loader runtime: Module build failed: TypeError: this.setDynamic is not a function 将 mini-css-extract-plugin 与 postcss-loader 一起使用时,模块构建失败 - Module build failed when using mini-css-extract-plugin with postcss-loader for less
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM