storybookjs / addon-svelte-csf

[Incubation] CSF using Svelte components.
MIT License
111 stars 32 forks source link

[Bug] Typing don't work with SvelteKit project #234

Open connerdassen opened 3 days ago

connerdassen commented 3 days ago

Describe the bug

None of the typings work in a SvelteKit project, while they work fine in a standalone Svelte + Vite project.

When creating a standalone Svelte + Vite project using npm create vite@latest and installing Storybook with npx storybook@latest init, I get full type support and Intellisense works for defineMeta, setTemplate and Story component props.



However, when creating a SvelteKit project through npx sv create myapp and selecting Storybook to be installed, the typings do not work, and there is no Intellisense or typed component props.

Expected behavior

Typings work on Sveltre

Environment

xeho91 commented 3 days ago

Hm, that's off. Given how different TCmp generic type is in both cases. It feels like some of the dependencies are missing. Maybe typescript-svelte-plugin?

JReinhold commented 3 days ago

Do you have the necessary file at .sveltekit/tsconfig.json? That is only generated after starting the actual SvelteKit app once, or running svelte-kit sync. You might need to restart VSCode/The Extension Host after that file has been generated.