[Bug] HMR doesn't work with Storybook 6.5.0
See original GitHub issueWhat version of vite
are you using?
2.9.9
System info and storybook versions
System: OS: macOS 12.3.1 CPU: Intel i7 Binaries: Node: 16.10.0 npm: 7.24.0 Browsers: Firefox Developer Edition 101.0b8 (64-bit) Chrome 101.0.4951.64
Describe the Bug
- To even be able to use
@storybookjs/builder-vite
i had to install@storybookjs/addon-svelte-csf
. It didn’t want to work without it (and i didn’t have any.svelte
stories yet. - After installing
@storybookjs/addon-svelte-csf
(had to do it forcefully as there were some dependency conflicts@storybookjs/builder-vite
stopped throwing errors. - Running
npm run storybook
seems to just show the latest build ran with Webpack. When changing the stories’ contents, no there is no active HMR. - Furthermore, if i remove
.sveltekit
andnode_modules
and then run
npm i
npm run storybook
i get this:
Attatching repo with this issue in ZIP
sveltekit-storybook-vite-builder.zip
Link to Minimal Reproducible Example
No response
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
@storybook/react | Yarn - Package Manager
▶️ Interactive stories to simulate user behavior and tools to debug it; ⚡️ On-demand architecture for smaller builds and faster load times; ⛸...
Read more >Upgrading Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >storybookjs/storybook (Raised $170.00) - Issuehunt
[Bug]: Storybook v5.3 not working with "no such file or directory, stat . ... unknow description with storybook 6.5.0 and vitejs 3.0.
Read more >MIGRATION.md - Storybook - Fossies
This is technically a breaking change, so if this affects you please file an issue in Github and we can consider reverting this...
Read more >@storybook/core: Versions | Openbase
Bug Fixes. Angular: Fix "webpack_require.nmd is not a function issue" in Angular 15 #20043; CLI/React native: Fix addons template to import register instead ......
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 FreeTop 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
Top GitHub Comments
That’s true, @smashercosmo, but the files should still update. They just flash instead of a smooth HMR. I think the issue that @allozaur was having originally was that there was a cached build in
node_modules/.cache
from webpack. And you hit the nail on the head for his other issue with global. Another possibility is to force jest-mock 28 to be used as described here: https://github.com/storybookjs/storybook/issues/15391#issuecomment-1129008376@IanVS ok, yeah, I think you’re right @allozaur seems like not working HMR is a known issue. HMR only works when you change components, not stories. It’s mentioned in the docs https://github.com/storybookjs/builder-vite#known-issues