-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
build-storybook fails with "No module factory available for dependency type: CssDependency" #9777
Comments
The issue is occurring on |
@ConnorDY so my suggestion didn’t work? We upgraded mini-css-extract-plugin to fix a SASS bug, but it might be causing this problem in your setup (is my hypothesis) |
We already had |
I see. Thanks for clarifying! Do you have a repro? |
Encountered the same here |
@shilman I found a fix for it. storybook's webpack config has it's own setup with rules and plugins and therefore surely has something missing if you merge your own webpack config with it. In my case, i've merged my rules, but forgot the plugins.
No build issues, and storybook works as expected with: mini-css-extract-plugin: ^0.9.0 |
@vertic4l does this workaround properly belong in the default storybook config? cc @ndelangen |
@shilman if you got some rules which are using the MiniCssExtractPlugin, then yes of course. In the end it's pretty obvious.. the config shouldn't have rules where corresponding plugin is missing. Best would be if something like Webpack could tell us, that there is a rule but no plugin for it. |
The reason for this issue was that i am using css modules, and got rules for it... but the plugin was missing. My main.js just didn't merge everything necessary for it to work.
|
The workaround @vertic4l mentioned is what we already had, although our fix looked a little different:
This was to fix the issue mentioned here: #9462. |
I started seeing this error after upgrading to react-scripts 3.3.1, downgrading to 3.3.0 has resolved it. mini-css-extract-plugin 0.9.0 |
@MrStevenHill That did it! Pinning I wonder what in the new release broke it: Maybe one of these: Awareness: @shilman |
cc @mrmckeb |
Interesting, I can take a look into this and try to understand how we can fix this in the preset. Has anyone got a repo that I can take a look at for reproduction? |
I'm having the same Issue:
|
We are also seeing this issue. Downgrading |
cc @mrmckeb 😭 |
Any news on this? It runs locally but on build We have: We get:
|
@bobsilverberg, sorry for the slow response. I was looking into this today and it looks like you're not using the preset for Create React App, but instead relying on the deprecated built-in preset. Have you tried using the new standalone preset? |
worked for me, thanks! |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
We are having the same problem in our team, and we installed the https://www.npmjs.com/package/@storybook/preset-create-react-app and it did not work. 😢 |
@kevinccbsg You need to check the given rules and the given plugins. That should be all. In my case (see above) i'm using the rules from my own webpack config, So the fix is, to add the plugins for the rules you are using, in my case adding the missing MiniCssExtractPlugin. |
@kevinccbsg I've updated the config above to show everyone my latest version. It fixes a similiar issue when using '@storybook/addon-docs'. It's all about having the right mix of storybook's own webpack config and yours to get everything work as expected. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
Describe the bug
Using 5.3.9 through the latest version of storybook,
build-storybook
fails with the following error:I've tried nuking my
node_modules
folder andpackage-lock.json
but I still get the same error.Expected behavior
The storybook should build successfully.
System:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 13.7.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.6 - /usr/local/bin/npm
Browsers:
Chrome: 79.0.3945.130
Safari: 13.0.5
npmPackages:
@storybook/addon-a11y: 5.3.12 => 5.3.12
@storybook/addon-actions: 5.3.12 => 5.3.12
@storybook/addon-backgrounds: 5.3.12 => 5.3.12
@storybook/addon-docs: 5.3.12 => 5.3.12
@storybook/addon-knobs: 5.3.12 => 5.3.12
@storybook/addon-links: 5.3.12 => 5.3.12
@storybook/addon-storyshots: 5.3.12 => 5.3.12
@storybook/addon-storysource: 5.3.12 => 5.3.12
@storybook/addon-viewport: 5.3.12 => 5.3.12
@storybook/addons: 5.3.12 => 5.3.12
@storybook/cli: 5.3.12 => 5.3.12
@storybook/react: 5.3.12 => 5.3.12
@storybook/source-loader: 5.3.12 => 5.3.12
Additional context
This was previously working fine when we were on 5.3.9 but now it doesn't even work on 5.3.9. This leads me to believe it's an issue with a newer version of one of storybook's dependencies.
The text was updated successfully, but these errors were encountered: