Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@storybook/builder-webpack5@6.5.0 breaks the babelModeV7 option #18263

Closed
mmis1000 opened this issue May 19, 2022 · 5 comments
Closed

@storybook/builder-webpack5@6.5.0 breaks the babelModeV7 option #18263

mmis1000 opened this issue May 19, 2022 · 5 comments

Comments

@mmis1000
Copy link

mmis1000 commented May 19, 2022

Describe the bug
A clear and concise description of what the bug is.

When in condition above, compilation failed with

ERR! TypeError: Cannot read property 'push' of undefined
ERR!     at Object.babel (/<project>/node_modules/@storybook/builder-webpack5/dist/cjs/presets/preview-preset.js:37:18)

To Reproduce

Enable both webpack5 builder and babelModeV7 in 6.5.0

System

Environment Info:

  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 AMD Ryzen 9 5950X 16-Core Processor
  Binaries:
    Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.0/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.15.0/bin/npm
  Browsers:
    Chrome: 92.0.4515.131
    Firefox: 90.0.2
  npmPackages:
    @storybook/addon-actions: ^6.5.0 => 6.5.0 
    @storybook/addon-essentials: ^6.5.0 => 6.5.0 
    @storybook/addon-links: ^6.5.0 => 6.5.0 
    @storybook/builder-webpack5: ^6.5.0 => 6.5.0 
    @storybook/manager-webpack5: ^6.5.0 => 6.5.0 
    @storybook/vue3: ^6.5.0 => 6.5.0 

Additional context

79e5f5a

This line of code is added in @storybook/builder-webpack5@6.5.0

@mandarini
Copy link
Contributor

Getting a different error, on Nx workspaces with React apps, still webpack5 related. Posted a comment here.

@Tim-arts
Copy link

Tim-arts commented May 19, 2022

Have the same issue on an Angular SB. In order to make it work I have to set both babelModeV7 and lazyCompilation options to false. My config below:

core: {
    builder: {
      name: 'webpack5',
      options: {
        lazyCompilation: true,
        fsCache: true,
      },
    },
},
features: {
    postcss: false,
    buildStoriesJson: true,
    storyStoreV7: true,
    babelModeV7: true,
},

Note that I'm using the default babel configuration as indicated on this page: https://storybook.js.org/docs/react/configure/babel

@shilman
Copy link
Member

shilman commented May 19, 2022

Ouch! Sorry gang, should have a fix in the next day or so.

@ntucker
Copy link

ntucker commented May 19, 2022

Is #18279 related to this? I don't have either of those options enabled; but I use custom webpack config so I assume that is equivalent to babelv7 mode?

@shilman
Copy link
Member

shilman commented May 23, 2022

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.4 containing PR #18284 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

@shilman shilman closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants