-
-
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
can't install Storybook in Svelte apps created with Vite or SvelteKit #15037
Comments
I don't think this will solve your problem, but more as an FYI: https://github.com/eirslett/storybook-builder-vite In addition to your instructions above, I upgraded storybook to the latest alpha and tried it with the standard webpack builder as well as with the vite builder. In both cases I got this error:
@j3rem1e is this something you have time to look at? |
The dependencies have been fixed in this PR : storybookjs/addon-svelte-csf#19 (not released) In for the error you see, it is the same issue as #11587 For svelte, the easiest way i found is :
For me, the main issue is that 'main.js' is require()d by the builder (core-common/serverRequire) but should be imported if the project is configured to uses type:module. however, i am clearly not an expert on this. cjs/esm on node is really...weird |
This workaround may help. |
This should be addressed in the recent versions of storybook 7 and the addon-svelte-csf. Please let us know if you're still having trouble with it. |
Describe the bug
Storybook for Svelte wants to use version 2.9.1 of svelte-loader, but Svelte apps created with Vite or SvelteKit want to use version 3.1.1. These appear to be incompatible and this prevents the use of Storybook in these projects.
To Reproduce
I tried to create a reproduction repo by running
npx sb@next repro
, but that errored out with "Failed to create repro".Here are steps that reproduce the issue:
npm init svelte@next storybook-issue
cd storybook-issue
npm install
npx sb init
npm audit fix
This will output the following:
System
Please paste the results of
npx sb@next info
here.The text was updated successfully, but these errors were encountered: