Webpack Hot Reload not working in react Storybook 6.0-rc.9
See original GitHub issueDescribe the bug After changing a story the page reloads and I get following message in the browser console
[HMR] The following modules couldn't be hot updated: (Full reload needed)
This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See https://webpack.js.org/concepts/hot-module-replacement/ for more details.
To Reproduce
- Fresh install of storybook 6 react with npx sb@next init --type react
- Go to the button story
- Change something inside ‘stories/Button.stories.js’
Primary.args = {
...
label: 'Button',
};
Expected behavior A hot reload without page reload
Screenshots
System:
Please paste the results of npx -p @storybook/cli@next sb info
here.
Environment Info:
System:
OS: Linux 5.4 Pop!_OS 20.04 LTS
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 10.19.0 - /usr/bin/node
Yarn: 1.22.4 - ~/.npm-global/bin/yarn
npm: 6.14.4 - /usr/bin/npm
Browsers:
Chrome: 83.0.4103.116
Firefox: 78.0.1
npmPackages:
@storybook/addon-actions: ^6.0.0-rc.9 => 6.0.0-rc.9
@storybook/addon-essentials: ^6.0.0-rc.9 => 6.0.0-rc.9
@storybook/addon-links: ^6.0.0-rc.9 => 6.0.0-rc.9
@storybook/react: ^6.0.0-rc.9 => 6.0.0-rc.9
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Storybook webpack repeatedly rebuilding (hot reloading over ...
There is an issue on GitHub (Webpack Building Constantly) describing a similar behavior. They solved it by changing the glob of the stories ......
Read more >Storybook does not refresh after save : r/pop_os - Reddit
I have created a Storybook and after when I change something and save it, the browser does not refresh automatically.
Read more >Sebastien Lorber • ⚛️ ThisWeekInReact.com on Twitter ...
An integration package between React-Three-Fiber and Remix Bridges Remix context to R3f => hooks can be used in R3f scenes directly https://github.com/nickjs/ ...
Read more >Webpack-热中间件, 热模块更换反应 ...
Webpack Hot Reload not working in react Storybook 6.0-rc.9 · 问题运行正常显示VUE-Ui 警告不能加载hot.js Hot Reload Not Working 2018 年12 月24 日sodatea 置顶 ...
Read more >Hot Reload - npm - Socket.dev
Storybook for Vue3: Develop Vue3 Component in isolation with Hot Reloading. storybook ... Webpack hot reloading you can attach to your own server....
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
Also confirm, using 6.0.21 and MiniCssExtractPlugin loader. HMR doesn’t work.
Moreover, once I run
yarn storybook
it throws an error: ERROR in ./src/styling/brands/XXX.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/mini-css-extract-plugin/dist/loader.js??ref–16-0!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js??ref–16-3!./src/styling/brands/XXX.scss) Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: expected “{”. ╷ 4 │ var cssReload = require(“/Users/XXX/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js”)(module.id, {“hmr”:true,“reloadAll”:true,“locals”:false}); │On the version 5.2.8 HMR works fine
@shilman can’t surely answer, I used the default config from https://webpack.js.org/plugins/mini-css-extract-plugin/#advanced-configuration-example and @storybook/preset-scss together -> HMR doesn’t work, and yarn storybook throws an error described above. Finally, I removed this preset -> and it works.