-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Webpack 5: Preview build fails, window/global #14407
Comments
Do you have a repro repo you can share? |
We think that there's something weird in your webpack config that's causing this line: https://github.com/storybookjs/storybook/blob/master/lib/theming/src/utils.ts#L2 To try to import this file: https://github.com/storybookjs/storybook/blob/master/lib/theming/src/global.ts Whereas it should load |
It's quite a huge project. I'll try to reduce it keeping this issue reproducible. |
Friendly ping. Any news or ETA on this? Maybe I can help somehow? |
@irudoy sorry for the slow response. i get a few different errors when i try to run your repro:
=>
As far as I can tell, these errors are not related to the original issue. Am I doing something wrong? |
@shilman strange. I just tried from scratch: |
I'll try a clean build later. Thanks! |
I have reproduced the problem on my machine. don't know what was happening earlier. @ndelangen and I played around with it to try to understand why this is happening, but didn't make any headway. We suspect it is a webpack bug related to resolution. Perhaps you can experiment with different versions? |
I took a look and the error is still there on 6.2.0-rc.3. It just comes out as a warning instead of an error. I also needed to disable the 'util' fallback:
When i do that and try to view the page, I get a |
@shilman I has disabled Define and Dotenv plugins because of another issue. It used unneeded env vars from some dotenv files, that used for backend app purposes. Anyway, seems like it doesn't affect this issue. Also, I don't clearly understand why you needed to disable the 'util' fallback. And it definitely works fine on 6.2.0-rc.3. You can try it on this branch: https://github.com/irudoy/sb-14407-repro/tree/working And another proof that Of course, |
Some news. The issue is happening only when using yarn berry. It's good with npm. |
Seems like this issue isn't happening in the latest 6.3 RC. Thanks! |
Trying to upgrade the storybook to the latest version with webpack 5.
Upgrading from [email protected] and [email protected]. In this case, all works fine with no issues.
But with [email protected] and [email protected] I have some issues that were workaround by pinning webpack and other dependencies with
resolutions
, and removingDefinePlugin
andDotenv
from final preview and manager configs.But one issue still occurs, and I can't figure out what causes it.
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: