-
-
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
[6.2.0-beta.0] webpack 5 error /webpack-virtual-modules/ #14012
Comments
Got a repro here: https://github.com/tonnguyen/storybook-taskbox |
I can confirm it's still present in the |
Yup. Open issue = problem hasn't been fixed yet |
OK, problem solved, at least for the repro https://github.com/tonnguyen/storybook-taskbox - "resolutions": {
- "webpack": "^5.23.0"
- }, Storybook uses webpack4 to build its "manager" UI (the thing around the user's iframe). When you use yarn resolutions to force it to use webpack5, that breaks. (h/t @igor-dv for the debugging help!) @sibelius @VincentLanglet are you using resolutions? |
we are using resolutions to avoid 2 versions of webpack |
Can we always use webpack 5 ? |
Not currently. We made the preview builder pluggable to switch between webpack4/5, but not the manager builder. Starting in Storybook 7 I expect we'll make webpack5 the default across the board, and users will be able to opt-in to webpack4 for the preview only. |
Closing this until somebody has a repro that doesn't use yarn resolutions 😂 |
Having both webpack4 and webpack5 in my nodes_modules is breaking all my webpack builds.
only storybook is failing. The release https://github.com/storybookjs/storybook/releases/tag/v6.2.0-beta.0 talk about Webpack 5 support. |
can we open an issue about this:
so the community could contribute to make it compatible with both wp 4 and wp 5 without yarn resolutions it breaks everything for us |
@VincentLanglet it says
what part of experimental isn't clear? |
@sibelius I've opened this issue #14044 and am interested to hear more feedback from the community. I would prefer not to add this feature if we can avoid it. It seems to me that if the user installs webpack5 in his project, that will be the preferred version of webpack, and the webpack4 installation will only exist in Storybook's |
If I upgrade to the latest beta and remove the resolution it works fine in Storybook with our without that line. |
"won't affect the user's installation at all" - this is incorrect as various webpack plugins do version detection to determine how to operate and they get confused by finding webpack 4 in the path. |
@shilman Not supporting pmmmwh/react-refresh-webpack-plugin is a pretty big deal. This is the standard way of enabling hotreloading for react. This and many other webpack plugins use version detection. |
For anyone stumbling across this from Google, here's the official Storybook with Webpack 5 guide: |
I fixed it by resolving to webpack-virtual-modules 0.4.3 and not 0.2.2 |
Describe the bug
To Reproduce
Install 6.2.0 beta in a monorepo with webpack 5, we does not work with target web neither node, below is the main.js config
Steps to reproduce the behavior:
start-storybook -p 9001 -c .storybook
Expected behavior
it should not break
Screenshots
the stacktrace is above
Code snippets
code snippet above
System
Additional context
The text was updated successfully, but these errors were encountered: