babel: Cannot read property 'join' of undefined ( preset-stage-0 )
Bug Report
Current Behavior When i try to run webpack I am getting the following error
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: [BABEL] SomeFile.js: Cannot read property 'join' of undefined (While processing: "informed/node_modules/@babel/preset-stage-0/lib/index.js")
at "informed/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
Input Code
// webpack config snippit
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
"@babel/preset-env",
["@babel/preset-stage-0", { "decoratorsLegacy": true }],
"@babel/preset-react"
],
}
}
},
Environment
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: Node: 9.5.0 NPM: 5.8.0
- OS: OSX 10.13.5
- Monorepo NO
- How you are using Babel: Webpack
Additional context/Screenshots
My project uses storybook and after updating to the latest beta release i started to have issues with babel. I tracked it back to an issue where there latest version started to use @babel/core
instead of the old V6. I have a seprate webpack config for my tests and for distribution/production and they are failing with the error above.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (8 by maintainers)
Commits related to this issue
- Fix stage-0/1 import of pipeline proposals array The proposals array is exported from the syntax plugin, so it must be imported from there as well. Fixes #8307. — committed to valtech-nyc/babel by mAAdhaTTah 6 years ago
- Update babel monorepo to v7.0.0-beta.54 (#235) This Pull Request renovates the package group "babel monorepo". - [@​babel/preset-typescript](https://github.com/babel/babel) (`devDependen... — committed to Pigmice2733/scouting-frontend by renovate[bot] 6 years ago
https://github.com/babel/babel/releases/tag/v7.0.0-beta.54
I also removed the requirement to specify the decorators/pipline plugin options (default to true/“minimal”). We are going to remove the Stage presets next which will require them but at least now you won’t have to specify anything, especially if you aren’t using them. You can always pin to an older version or use beta.54.
I generally agree; in this case, we can’t do that because there is no “default” for the pipeline operator that won’t be a breaking change when one of the three proposals becomes the actual default, accepted behavior.
I think that the ideal developement cycle would be something like
It doesn’t take much more time than using the stage presets, since Babel helps the user by actually saying what to do.
@hzoo we now have to manually include every plugin listed in https://babeljs.io/docs/en/babel-preset-stage-3 and https://babeljs.io/docs/en/babel-preset-stage-2?