babel: Transform Generator Plugin Fails
EDIT by @hzoo: make sure babel-core is >= 6.26.0, and in general keep the babel deps the same version
Transform Generator Plugin Fails
Input Code
I grab the lastest version of babel:
… babel-plugin-transform-object-rest-spread@6.26.0 node_modules/babel-plugin-transform-object-rest-spread ├── babel-plugin-syntax-object-rest-spread@6.13.0 └── babel-runtime@6.26.0 (regenerator-runtime@0.11.0, core-js@2.5.0)
babel-preset-es2015@6.6.0 node_modules/babel-preset-es2015 ├── babel-plugin-transform-es2015-block-scoped-functions@6.22.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-arrow-functions@6.22.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-typeof-symbol@6.23.0 (babel-runtime@6.26.0) ├── babel-plugin-check-es2015-constants@6.22.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-literals@6.22.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-spread@6.22.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-template-literals@6.22.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-function-name@6.24.1 (babel-types@6.26.0, babel-helper-function-name@6.24.1, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-unicode-regex@6.24.1 (regexpu-core@2.0.0, babel-helper-regex@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-duplicate-keys@6.24.1 (babel-types@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-object-super@6.24.1 (babel-helper-replace-supers@6.24.1, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-for-of@6.23.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-sticky-regex@6.24.1 (babel-helper-regex@6.26.0, babel-types@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-shorthand-properties@6.24.1 (babel-types@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-computed-properties@6.24.1 (babel-template@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-destructuring@6.23.0 (babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-parameters@6.24.1 (babel-helper-get-function-arity@6.24.1, babel-helper-call-delegate@6.24.1, babel-types@6.26.0, babel-template@6.26.0, babel-traverse@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-modules-commonjs@6.26.0 (babel-plugin-transform-strict-mode@6.24.1, babel-types@6.26.0, babel-template@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-block-scoping@6.26.0 (babel-types@6.26.0, babel-template@6.26.0, babel-traverse@6.26.0, babel-runtime@6.26.0) ├── babel-plugin-transform-es2015-classes@6.24.1 (babel-helper-optimise-call-expression@6.24.1, babel-messages@6.23.0, babel-helper-replace-supers@6.24.1, babel-helper-define-map@6.26.0, babel-helper-function-name@6.24.1, babel-types@6.26.0, babel-template@6.26.0, babel-traverse@6.26.0, babel-runtime@6.26.0) └── babel-plugin-transform-regenerator@6.26.0 (regenerator-transform@0.10.0)
babel-core@6.7.7 node_modules/babel-core ├── slash@1.0.0 ├── shebang-regex@1.0.0 ├── path-exists@1.0.0 ├── path-is-absolute@1.0.1 ├── private@0.1.7 ├── convert-source-map@1.5.0 ├── babel-code-frame@6.26.0 (js-tokens@3.0.2, esutils@2.0.2) ├── debug@2.6.8 (ms@2.0.0) ├── minimatch@2.0.10 (brace-expansion@1.1.8) ├── babylon@6.18.0 ├── json5@0.4.0 ├── source-map@0.5.6 ├── lodash@3.10.1 ├── babel-runtime@5.8.38 (core-js@1.2.7) ├── babel-register@6.26.0 (home-or-tmp@2.0.0, source-map-support@0.4.15, mkdirp@0.5.1, babel-core@6.26.0, babel-runtime@6.26.0, lodash@4.17.4, core-js@2.5.0) ├── babel-messages@6.23.0 (babel-runtime@6.26.0) ├── babel-template@6.26.0 (lodash@4.17.4, babel-runtime@6.26.0) ├── babel-helpers@6.24.1 (babel-runtime@6.26.0) ├── babel-generator@6.26.0 (trim-right@1.0.1, jsesc@1.3.0, detect-indent@4.0.0, lodash@4.17.4, babel-runtime@6.26.0) ├── babel-types@6.26.0 (to-fast-properties@1.0.3, esutils@2.0.2, lodash@4.17.4, babel-runtime@6.26.0) └── babel-traverse@6.26.0 (globals@9.18.0, invariant@2.2.2, lodash@4.17.4, babel-runtime@6.26.0)
When i try and transpile my code: Module build failed: Error: Plugin 20 specified in “/my app folder/node_modules/babel-preset-es2015/index.js” provided an invalid property of “name” at Plugin.init (/my app folder/node_modules/babel-core/lib/transformation/plugin.js:115:13) at Function.normalisePlugin (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:149:12) at /my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:183:30 at Array.map (native) at Function.normalisePlugins (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:155:20) at OptionManager.mergeOptions (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:277:36) at /my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:349:14 at /my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:369:24 at Array.map (native) at OptionManager.resolvePresets (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20) at OptionManager.mergePresets (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10) at OptionManager.mergeOptions (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14) at OptionManager.init (/my app folder/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10) at File.initOptions (/my app folder/node_modules/babel-core/lib/transformation/file/index.js:194:75) at new File (/my app folder/node_modules/babel-core/lib/transformation/file/index.js:123:22) at Pipeline.transform (/my app folder/node_modules/babel-core/lib/transformation/pipeline.js:45:16)
I assume that plugin 20 is: babel-plugin-transform-regenerator@6.26.0 (regenerator-transform@0.10.0)
Babel Configuration (.babelrc, package.json, cli command)
"babel-core": "~6.7.4",
"babel-loader": "~6.2.4",
"babel-plugin-resolver": "^1.0.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-preset-es2015": "~6.6.0",
Expected Behavior
It shouldn’t barf
Current Behavior
Barfs
Context
Can’t build
Your Environment
Nothing special. I have a build server where I am getting the latest version of all my dependencies during each run.
software | version(s) |
---|---|
Babel | babel-core@6.7.7 |
node | v0.10.46 |
npm | 2.12.0 |
Operating System | linux |
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 43 (17 by maintainers)
@benjamn published
regenerator-transform@0.10.1
so this should be ok https://github.com/facebook/regenerator/commit/30d34536b9e3f7a2873b04a16ec66fec9c8246f6 with Logan’s PR ^.babel-preset-es2015 uses
babel-plugin-transform-regenerator
which uses “regenerator-transform”: “^0.10.0” so it should be updated.@wdalrymple You should use the same version for every babel package. So use either always
^version
or always~version
in your package.json.Thanks everyone! I would tend to suggest using ^ for deps (or at least be consistent with it’s usage), and use a lockfile (yarn/npm package-lock) since it’s hard for all libraries/deps to not break
That fixed it for me. Thanks guys ^^
@existentialism Change to
babel-core@6.26.0
worked. Built successfully. Everyone else try to update to this version of core as well.Ahh, that would make sense. Seems to line up with the error that I am seeing.
@wdalrymple confused… don’t think preset-env is being used?
@jmrapp1 can you try babel-core@6.26.0?
Same issue here.
Seeing this too.
I ran into this issue as well today and have been scouring the internet trying to find a fix. I’ve tried everything from re-installing npm & node, re-cloning the repository from the point that it was working, and countless other small things, but nothing has worked.