Skip to content
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

Problem after updating from 0.1.13 to 0.1.14. Sveltekit + Typescript + Storybook #224

Closed
bergser opened this issue Jan 31, 2022 · 3 comments · Fixed by #240
Closed

Problem after updating from 0.1.13 to 0.1.14. Sveltekit + Typescript + Storybook #224

bergser opened this issue Jan 31, 2022 · 3 comments · Fixed by #240

Comments

@bergser
Copy link

bergser commented Jan 31, 2022

Hi! After updating storybook-builder-vite version from 0.1.13 to 0.1.14 all stories disappear.

console:
Unexpected default export without title in './src/stories/Button.stories.svelte': undefined

screenshot:
image

Example: https://github.com/SergeiZheleznov/sb-svelte-vite-example

The only thing changed is storybook-builder-vite version

@IanVS
Copy link
Member

IanVS commented Jan 31, 2022

Thanks for the report. I can't think of anything that would have changed to cause this, and unfortunately I'm not able to get our own svelte example working due to #50. Is it possible that @storybook/addon-svelte-csf is not behaving correctly? I see a warning about configure(), where is that coming from?

@Narigo
Copy link

Narigo commented Feb 3, 2022

I can confirm this report with my SvelteKit boilerplate. I have updated all packages today, if you try updating from [email protected] to [email protected], it will say that it cannot find any stories.

@thomaswilsonxyz
Copy link

Hi, I've had exactly this problem as well after updating from. (We're running SvelteKit 1.0.0-next.241.)

For now, we've solved this by reverting back to 0.1.13.

Some interesting observations I made while bughunting with a colleague:

  • We're using the wildcard * to find stories in a relative directory, in which case the frontend is throwing the error index.js:56 Unable to load story '*':. When I changed the stories properties in the main.js file for storybook to point to one specific story file (e.g. ../stories/Button.stories.svelte) I get an error pointing towards another story in that directory. It was the same Unable to load story... error, but with a reference to a hashed fildname for another story in that same directory.
  • After nuking and re-loading node_modules, I got the same * error message (same main.js file)
  • I (unreliably) got an error telling me that config.stories was no longer supported on the storybook main.js file. we're not using the nested config.stories structure, but the plain stories field, as per the Storybook documentation.

I'm unsure if there's a reference to another configuration object / file for Storybook, but it's like I couldn't hook into Storybook through the config.

@bfanger bfanger mentioned this issue Feb 12, 2022
IanVS pushed a commit that referenced this issue Feb 17, 2022
1. Re-enabled the csfPlugin for svelte
2. Updated svelte dependencies, that fixed a `TypeError: RegisterContext is not a constructor` error. (Svelte compiler was in 'ssr' mode)

Fixes #224

(Also implemented support for preprocessors inside *.stories.svelte files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants