storybook: [Storybook 6.0.0-beta.16] HMR not working properly

Describe the bug

There seems to be an issue with Hot module reloading and the latest changes in Storybook. Webpack seems to pickup the changes and rebuild accordingly, but it’s behaving really weirdly in a lot of different scenarios (click on each gif to open in better resolution):

1 - Changing arbitrary code It’s necessary to refresh in order to see the changes. Kapture 2020-05-27 at 20 42 12

2 - Renaming the default title of a story It’s duplicating the stories in the manager. namebug

3 - Adding/removing stories It’s not reacting accordingly Kapture 2020-05-27 at 20 35 59

At the end of the video above I commented all stories, and as a result I got this (render of the button + message saying there was no preview) image

To Reproduce Use the gifs on top as a reference.

Expected behavior HMR should be working correctly, with changes being picked up and reacting accordingly.

Screenshots image Kapture 2020-05-27 at 20 35 59 namebug

The issue happened to me using a starter from Vue + TS and the starter from sb init. I will check if it’s happening with other frameworks, although I believe it is.

System: Environment Info:

System:
  OS: macOS 10.15.4
  CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
  Node: 12.16.1 - /usr/local/bin/node
  Yarn: 1.22.4 - /usr/local/bin/yarn
  npm: 6.13.4 - /usr/local/bin/npm
Browsers:
  Chrome: 83.0.4103.61
  Firefox: 74.0
  Safari: 13.1
npmPackages:
  @storybook/addon-actions: ^6.0.0-beta.16 => 6.0.0-beta.16 
  @storybook/addon-links: ^6.0.0-beta.16 => 6.0.0-beta.16 
  @storybook/addons: ^6.0.0-beta.16 => 6.0.0-beta.16 
  @storybook/vue: ^6.0.0-beta.16 => 6.0.0-beta.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

Thanks @yannbf

Can confirm it’s behaving similarly in a React project + Beta 16