Closed JReinhold closed 2 years ago
Exactly same here. So seems like more of a "global" issue rather than single example
Pff, super strange, I don't think I touched runtime code indeed.
I do import svelte here, which could maybe have an effect?
This could be an import type { SvelteComponentTyped } from 'svelte'
, to make sure that didn't break anything.
Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.45 containing PR #19653 that references this issue. Upgrade today to the @next
NPM tag to try it out!
npx sb upgrade --prerelease
Closing this issue. Please re-open if you think there's still more to do.
@JReinhold @kasperpeulen any idea why this wasn't caught in CI?
It only failed when starting storybook in dev mode, not when building. We don't have any tests that start storybook and navigate to stories, as far as I know.
Aha makes sense. @ndelangen @tmeasday any thoughts about this?
I guess it makes the case we should smoke test all sandboxes after all @ndelangen
That's not great news. So we have to figure out how to run all of them..
Just to be explicit, for us to have caught this bug in CI, we would need to:
Non-trivial.
I think the test runner could handle smoke testing the stories after launching the dev server, right? And honestly, since we're already testing each story in the prod build, it might be enough to just test one story in dev. Normally with this kind of issue they all break, not just one or two.
That's pretty fair, I think the test-runner at a dev server is a much better test than the smoke test. WDYT @ndelangen?
Describe the bug
When creating a fresh Svelte project and adding Storybook with
npx sb@next init
, none of the example stories render correctly, instead throwing the error:Googling the error make it seems like it's a fairly common error related to modules, building or similar.
To Reproduce
standalone SvelteKit setup
svelte-vite/default-js
SandboxWithin the SB repo:
System
Additional context
v7.0.0-alpha.42
. Most likely https://github.com/storybookjs/storybook/pull/19512 because the other PRs in that release doesn't touch Svelte nor Vite AFAIK. On the surface I can't see any changes in that PR that would cause this as it's mostly just types and tests. @kasperpeulen can you point to any runtime changes you made there that could cause the rendering/building to break?svelte-vite/default-js
sandbox so I think we can rule out SvelteKit issues here.I narrowed it down by creating a new Svelte project with Storybook and pinning all the versions to
7.0.0-alpha.41
(without the^
) inpackage.json
and rannpm install
. This worked, but changing it to7.0.0-alpha.42
made it break.Here's the relevant Svelte source code for the error: https://github.com/sveltejs/svelte/blob/01a91163a9ffd6d18ea4699cef4c531b72fbfc00/src/runtime/internal/dev.ts#L161-L206 https://github.com/sveltejs/svelte/blob/815bc7ef6e91ea10e7de2c46325e32dd44939b84/test/runtime/index.ts#L304-L310
Svelte explicitly only throws this error in Dev mode, so it might not have anything to do with our dev vs build setup.