Closed CarlAmbroselli closed 1 month ago
Same here but using svelte-vite
without sveltekit
.
We can fix this by removing getAbsolutePath
and do not use workspaces
in the package.json
of our monorepo.
Do you have a repo where I can test this setup ?
Try it here: https://github.com/tomolenet/addon-svelte-csf-160
Any news on this? Can we support? Looks like the compiler can not parse Svelte?
/home/devs/addon-svelte-csf-160/node_modules/@storybook/addon-svelte-csf/dist/components/Meta.svelte:1
<script>
^
SyntaxError: Unexpected token '<'
@tomolenet does the workaround mentioned at https://github.com/storybookjs/builder-vite/issues/321#issuecomment-1872225287 solve your issue?
Describe the bug
I'm trying to get this to run, but it fails to start.
Key differences from readme:
import { sveltekit } from '@sveltejs/kit/vite';
instead of using@sveltejs/vite-plugin-svelte
@storybook/sveltekit
instead of@storybook/svelte-vite
I'm using a monorepo, hence the node_modules folder is one layer above my project.
My .storybook/main.js file looks like the following:
One thing that stands out to me is the
getAbsolutePath('@storybook/sveltekit'),
piece, which differs from the README, but is afaik the new supported framework. ThegetAbsolutePath
part of it was auto-generated from thenpx storybook@latest init
command already, which detected the monorepo setup.Also, this is sveltekit, so in my vite config I'm not using
'@sveltejs/vite-plugin-svelte
, but insteadimport { sveltekit } from '@sveltejs/kit/vite';
, which also differs from the README.Screenshots and/or logs
Environment
Versions
I'd appreciate any help around what else I could try to get this to work!