storybookjs / addon-svelte-csf

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

[Bug] No matching story indexer found for .svelte files. #93

Closed smart closed 1 year ago

smart commented 1 year ago

Describe the bug

I've just set up the new Storybook 7 beta with zeroconfig sveltekit (https://storybook.js.org/blog/storybook-for-sveltekit/). It worked out of the box for *.stories.js stories. I found this project to get .svelte support. I installed it as directed, but I don't seem to be able to index the .svelte stories. Error and my main.ts file below.

Error

Unable to index ./src/lib/components/PageHeader.stories.svelte: Error: No matching story indexer found for

main.ts

import type { StorybookConfig } from '@storybook/sveltekit'; const config: StorybookConfig = { stories: ['../src//*.mdx', '../src/*/.stories.@(js|jsx|ts|tsx)', '../src//*.stories.svelte'], addons: [ '@storybook/addon-svelte-csf', '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions' ], framework: { name: '@storybook/sveltekit', options: {} }, docs: { autodocs: 'tag' } }; export default config;

MacOS pnpm 7.26.3 Storybook 7.0.0-beta.63

JReinhold commented 1 year ago

The story indexer requires v3 of addon-svelte-csf which is still on the next release channel. Any chance you installed the stable v2 version instead?

Try pnpm add @storybook/addon-svelte-csf@next

smart commented 1 year ago

That was it, thank you!