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

[Bug]: @storybook/[email protected] (last) version broke my build #15

Open
sneridagh opened this issue Apr 2, 2025 · 4 comments
Open
Labels
bug Something isn't working

Comments

@sneridagh
Copy link

Describe the bug

It stopped processing correctly my code with the appropiate loader:

File was processed with these loaders:
 * ../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_react@1_e47opld2fqcym26bujw6mnihf4/node_modules/@storybook/preset-react-webpack/dist/loaders/react-docgen-loader.js
You may need an additional loader to handle the result of these loaders.
|
| const ConnectionRefused = () => (
>   <Container
|     className="view-wrapper"
|     style={{
Module parse failed: Unexpected token (17:2)
File was processed with these loaders:
 * ../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_react@1_e47opld2fqcym26bujw6mnihf4/node_modules/@storybook/preset-react-webpack/dist/loaders/react-docgen-loader.js
You may need an additional loader to handle the result of these loaders.
|  */

Going back to 3.0.3 solved the issue.

Reproduction link

It's a build problem...

Reproduction steps

Use 3.0.6 version of @storybook/addon-webpack5-compiler-babel I guess with any codebase, it no longer load the appropiate loaders.

Downgrade to 3.0.3 works again.

System

System:
    OS: macOS 15.3.2
    CPU: (10) arm64 Apple M1 Max
    Shell: 5.1.12 - /opt/homebrew/bin/bash
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    Yarn: 1.22.17 - ~/.yarn/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 9.1.1 - ~/.nvm/versions/node/v22.14.0/bin/pnpm <----- active
  Browsers:
    Chrome: 134.0.6998.166
    Safari: 18.3.1
  npmPackages:
    @storybook/addon-actions: ^8.0.4 => 8.6.11
    @storybook/addon-controls: ^8.0.4 => 8.6.11
    @storybook/addon-docs: ^8.0.4 => 8.6.11
    @storybook/addon-essentials: ^8.0.4 => 8.6.11
    @storybook/addon-links: ^8.0.4 => 8.6.11
    @storybook/addon-webpack5-compiler-babel: ^3.0.3 => 3.0.6
    @storybook/react: ^8.0.4 => 8.6.11
    @storybook/react-webpack5: ^8.0.4 => 8.0.4
    @storybook/theming: ^8.0.4 => 8.6.11
    storybook: ^8.0.4 => 8.6.11

Additional context

No response

@sneridagh sneridagh added the bug Something isn't working label Apr 2, 2025
Copy link

greptile-apps bot commented Apr 2, 2025

** Disclaimer** This information might be inaccurate, due to it being generated automatically
In packages/addon-webpack5-compiler-babel/src/index.ts, modify the webpack configuration for JS/JSX files. After the react-docgen-loader (located in packages/preset-react-webpack/dist/loaders/react-docgen-loader.js), append an extra babel-loader entry. For example, in the rule matching /.(m?js|jsx)$/ that is constructed there, add:

use: [
{ loader: require.resolve('babel-loader'), options: { presets: [require.resolve('@babel/preset-react')] } }
]

This adjustment restores the loader chain from 3.0.3 by chaining babel-loader after react-docgen-loader so that JSX is properly processed.

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Edit Issue Bot Settings · Greptile

@sneridagh
Copy link
Author

@ddadamhooper @valentinpalkovic @ndelangen #14 is a breaking change, and you released a patch version, which, inevitably will break builds.

@valentinpalkovic valentinpalkovic transferred this issue from storybookjs/storybook Apr 2, 2025
@valentinpalkovic
Copy link
Contributor

@sneridagh Thank you for opening the issue.
Can you tell us a bit about your repository structure or provide a reproduction?

@sneridagh
Copy link
Author

@valentinpalkovic to my understanding, you removed an include:

https://github.com/storybookjs/addon-webpack5-compiler-babel/pull/14/files#diff-fdf7d977684d2ffb6d06be349c695c00e873f56842cd54d7d67a8e08006e2299L35

that people configs could rely on. This is a breaking change, and should be released as that. That's all, I'm not saying that it's not right or wrong, but releasing it as a patch, in fact broke my build, and probably others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants