-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Static site with an endpoint fails when adding @storybook/svelte
dependency
#898
Comments
Here's an example of getting Storybook working with SvelteKit: https://github.com/tejasag/sveltetron-9000 |
The linked example also fails to build, although for a different reason:
It runs with
export async function get() {
return {
body: {
title: 'test'
},
};
}
<script context="module">
export async function load({ fetch }) {
const getData = (resourceName) =>
fetch(resourceName).then((res) => res.json());
return {
props: {
content: await getData(`/test.json`),
},
};
}
</script>
|
@benmccann The issue is still there. Even in the repo you linked. In fact, the minimal repro repo I linked shows that the issue has nothing to do with how Storybook is configured. It seems to be affected by the presence of the JSON endpoint and Storybook dependency, which somehow interferes with the kit build process. |
Some ideas:
|
I tried Node 14 and played with Vite's I followed the dependencies and starting with Note difference in the modules transformed count. |
Hmm. It's a bit weird to include Webpack in a Vite application as they're both bundlers and that's duplicate functionality. The solution for this probably is storybookjs/storybook#14024 In the meantime maybe you can find an alternative that doesn't depend on Webpack like https://github.com/rixo/svench |
It is a bit odd that Webpack is included as core dependency (it's the dependency of At least I know the exact package that causes the problem. I'll keep an eye on that issue you linked. I'll also try out Svench. Never heard of it. Thanks. |
For anyone interested. I followed the dependencies further and narrowed it down to |
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
This is due to a dependency issue which break current Svelte Kit version when storybook is present as dependency. More details: sveltejs/kit#898
Describe the bug
adapter-static
which loads data from a local JSON endpoint.svelte-kit build
to successfully build the app@storybook/svelte
(or@storybook/addon-essentials
) dependencysvelte-kit build
to fail the build with500 /
error (same error if using incorrect endpoint name)The issue only happens when building the app. It works as expected when running
svelte-kit dev
.I'm not sure whether the issue is with Storybook or Svelte Kit. Raising it here as it seems specific to Svelte Kit.
Logs
Server log
To Reproduce
A minimum reproduction app can be found at tyom/repro-svelte-kit-build-fail. There are two commits that show the working example (without Storybook dependency) and failing (with Storybook dependency).
Expected behavior
Svelte Kit should build the static site with Storybook present in dev dependencies.
Information about your SvelteKit Installation:
Diagnostics
Severity
This issue prevents me from havubg Storybook dependency in the same
package.json
as the Svelte app, which has local endpoints that fetch data inload
function.The text was updated successfully, but these errors were encountered: