-
Notifications
You must be signed in to change notification settings - Fork 3
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
Error with storybook #40
Comments
In our specific config (vite + swc, see above), stailwc needs @swc/plugins-styled-components (instead of @swc/plugin-emotion in repo example) which is runtime-built with a specific version of swc_core depending on version... AND, in the meantime, last version of stailwc is built in runtime using "@swc/core": "^1.3.62",
"@swc/plugin-styled-components": "^1.5.67", This fixed our issue but it would be great to specify @swc/xxx versions in Vite examples of this repo. @arlyon |
For the record, just by updating Careful use swc/plugin-styled-components version! |
For some context on why this error may happen, stailwc is unfortunately quite tightly coupled to the version of SWC being used to run it, as SWC is currently a very turbulent (pre-1.0) codebase. This types of errors will happen frequently, so my recommendation is to make sure to pin your versions. If you have known-working versions to report, I will add them to the compatibility chart on the readme. |
We met difficulties to setup a Storybook on a Vite project that use stailwc. (https://storybook.js.org/docs/react/configure/frameworks#configure)
We can successfuly make
tw
working in our exported components in our dist directory (that we include in another project, so rollup works well).But we got the following error when we are running
RUST_BACKTRACE=full npm run storybook
:Is there any good practice to setup storybook using your lib ?
Here is our vite.config.ts :
And here is our .storybook/main.tsx :
Thanks a lot
The text was updated successfully, but these errors were encountered: