How to import +page.svelte to test #231
Answered
by
JReinhold
simonhackler
asked this question in
Q&A
-
I am currently running svelte 5 and this addon in the next branch. Is it possible to import a +page.svelte to storybook somehow? |
Beta Was this translation helpful? Give feedback.
Answered by
JReinhold
Nov 17, 2024
Replies: 1 comment 5 replies
-
It should not be difficult to import the component (of the <!-- ./stories/page.stories.svelte -->
<script module>
import Page from "../routes/+page.svelte";
const { Story } = defineMeta({
component: Page,
});
</script> However, if inside this page component you use some of SvelteKit features, you might have to mock them. EDIT. And one more thing. For SvelteKit integration you have to use |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the reproduction @simonhackler! I've identified it as a bug in core Storybook and reported it here: storybookjs/storybook#29636
I can't come up with an easy workaround right now, unfortunately.