-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: HMR not working on SvelteKit and Storybook #21053
Comments
After looking into it more, updates to .stories.* files trigger hmr but not the .svelte file iteslf |
Facing the same issue, has anyone figured any workaround until this is fixed? I shall post one too as soon as i find out |
Just tried it out on a fresh sveltekit install instead of my big project, same issue. Also the HMR doesnt happen even if I edit the *.stories.ts file. One thing to note is that the terminal correctly shows that the HMR is done, but the info does not reach the localhost & on checking the websocket messages, nothing is send, so issue is not in triggering, but in communicating, most probably. |
Just trying out storybook myself with Sveltekit. Was not an easy experience as a pnpm user. However, I finally got it going and am now running into this same issue. No updates reflected in the browser, while the terminal window is reflecting an hmr update. This is with a fresh barebones test project. |
For anyone still looking at this I am using https://histoire.dev/ because it works very well for svelte/sveltekit. Will most likely go back to Storybook once out of beta. |
I've investigated this, and concluded that the Vite plugin introduced in #20804 that ensures that SSR builds are always disabled, is causing this. Creating a fresh SvelteKit+Storybook 7 project and only adding the following to the
(removing all SvelteKit's plugins or replacing the SvelteKit plugin with the Svelte plugin didn't change anything) I don't understand why that plugin has an impact at all on the dev server, since it should only have an effect when building static outputs. It might be something regarding the order in which Vite configs/plugins are applied, SvelteKit plugins being async and this one not. I'll investigate further ASAP, but in the mean time if @IanVS or @benmccann have an idea on why this breaks it, I'd love to hear it. |
That's weird. I don't have any idea why it would cause an issue |
Yippee!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.56 containing PR #21290 that references this issue. Upgrade today to the
|
@samhren @anim8rDev @rohanrajpal this should be fixed in |
Thanks a lot! It's now working as expected. |
I've started facing this issue again, anyone else facing it too? using |
@rohanrajpal can you provide a minimal reproduction? I quickly tried to reproduce this in a fresh SvelteKit project, and it's working fine as far as I can tell. |
Hey @JReinhold, its working great on a fresh install, tho i finally found the issue If i use https://houdinigraphql.com/, it involves setting upa houdini() plugin in the import { sveltekit } from '@sveltejs/kit/vite';
import houdini from 'houdini/vite';
import { defineConfig } from 'vite';
import { sentrySvelteKit } from '@sentry/sveltekit';
export default () => {
return defineConfig({
plugins: [
...[process.env['npm_lifecycle_event'] !== 'storybook' ? houdini() : []],
sentrySvelteKit({
sourceMapsUploadOptions: {
org: 'spur-ma',
project: 'spur-website',
},
autoUploadSourceMaps: true,
adapter: 'vercel',
}),
sveltekit(),
],
});
}; not the most elegant solution, one thing is that houdini constantly polls my backend for getting the latest graphql schema, could that be causing issue with storybook websockets? |
Here is a minimum reproduction of the issue https://github.com/rohanrajpal/houdini-storybook-hmr-bug-repro Also conversation with the creator of houdini is going on at : His initial reply
i commented watchSchema and confirm that its not related to polling, my bad @JReinhold do you know what might be the possible issue? also should i create a new issue for this? |
Describe the bug
Hot module reload is not working with a fresh install of sveltekit and storybook.
To Reproduce
System
Additional context
No response
The text was updated successfully, but these errors were encountered: