Help wanted: Vite + Svelte HMR is not working properly when making changes to stories
See original GitHub issueDescribe the bug We are working on Storybook integration with Vite and Svelte to improve the developer experience in our company. Everything was so good and we are super appreciative of your work in integrating Vite builder into Storybook. However, the fun didn’t last very long until we realised HMR doesn’t work properly with Storybook files. Although, there was probably a fix for this issue already, it is pretty React-specific at the moment, Svelte is still suffering from this unfortunately.
Dependencies
"@storybook/addon-actions": "^6.4.13",
"@storybook/addon-docs": "^6.4.13",
"@storybook/addon-essentials": "^6.4.13",
"@storybook/addon-links": "^6.4.13",
"@storybook/addon-svelte-csf": "^1.1.0",
"@storybook/svelte": "^6.4.13",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
"storybook-builder-vite": "^0.1.13"
And a simple configuration in main.cjs
module.exports = {
core: {
builder: "storybook-builder-vite"
},
stories: [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx|svelte)"
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-svelte-csf"
],
framework: "@storybook/svelte",
svelteOptions: {
preprocess: require("svelte-preprocess")()
},
}
Any help would be very appreciated. Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Help wanted: Vite + Svelte HMR is not working properly when ...
Basically, changes made to the components are rendered properly. But no reflection whatsoever, when changes are made to the stories files ...
Read more >Server Options - Vite
Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not...
Read more >Elder.js – An Opinionated, SEO Focused, Svelte Framework
For Vite the HMR on SvelteKit is better than Elder.js but SvelteKit doesn't offer Partial Hydration. The main difference is Elder.js is designed ......
Read more >Vite Svelte on build dynamic import don't work anymore
The import paths probably have to be known at build time for this to work correctly, i.e. the argument to import() has to...
Read more >Adding Vite to Your Existing Web App | CSS-Tricks
Now that the development server is running, try modifying your source code. The output should update almost immediately via Vite's HMR. This is ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Ian! Yes, this does seem to be working fine now. There is actually another bug I found but I will open that as a separate issue.
For this one, nicely done and thank you very much for the works.
Thanks. That seems to have solved the warnings now.