-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Can't use with storybook due to html-webpack-plugin
issues
#1551
Comments
Worked around by explicitly adding |
Yeah I'd stick with a version of |
Is this error related to the same reason?
|
@ThunderArmy Have you added another version of |
Nope, i just ran
|
@ThunderArmy Ah, yeah, storybook pulls in another version. You might need to use another version of storybook, or, if you can, try it with Yarn. On my own system, Yarn 1 can handle that just fine. It'll use the correct version of Might not be a valid option for you, but thought I'd mention it nonetheless. |
Yup, uninstalling it and using yarn works fine, but now i cannot get storybook to load the default components |
Okay apparently i had both the react and the preact version installed with caused issues after removing the react version of storybook it seems to load the stories just fine |
@rschristian After trying to add my own component its not using classes I assign to it
Although the code explicitly adds a class using Any ideas what that might come from? |
I've never touched storybook, but we enable CSS modules for I'm not sure how storybook works. You run a separate CLI with it, right? Probably need to enable CSS modules for those directories too. |
I can't get it to work, even after adding css-modules using their templates Nevertheless its an issue on their side and not on preact's |
Have a repo you can share? I can try to take a look soon here after I finish dinner. |
That would be awesome. I can quickly try to set up a test repo |
Alright, repo is up under https://github.com/ThunderArmy/preact-storybook-test-demo |
Sorry, but what do I need to do here to reproduce your issue? You seem to have no CSS module usage in your storybook stuff? |
The problem is storybook won't load the css class within button.js https://github.com/ThunderArmy/preact-storybook-test-demo/blob/main/src/components/button/index.js |
Gotcha, was looking in |
@ThunderArmy Sorry for the delay, got side tracked. I just did a quick search and it seems like someone's created a package to do this, worked with a simple install + adding to your config: https://github.com/Negan1911/storybook-css-modules-preset. Gets ~50k downloads a month from NPM, and works with Preact-CLI too. You'll just need to make your CSS files Plus, if it stops working, that's someone else's job to fix, lol. Benefits of not owning the config. |
Its fine, thanks for the help. Appreciate that a lot! Removing the old dependencies for the presets i tried before and adding the one you recommended works fine, thanks. thats a huge benefit, agreed xD |
What is the current behaviour?
Looks like trying to use this with
storybook
causes builds to stop working, because storybook useshtml-webpack-plugin@4
andpreact-cli
uses version 3, clashing with each other. When I runpreact build
while both are installed, I get:and then because of how
preact
works the github action/vercel build i run just goes forever and then times out after 6 hours (expensive!)Related: jamesjieye/html-webpack-exclude-assets-plugin#18
Steps to Reproduce
create a preact app, then install storybook, and then try to run
yarn build
What is the expected behaviour?
the build works
Please mention any other relevant information
i'll try to add a minimal repro soon.
The text was updated successfully, but these errors were encountered: