Hot Module Reload in web components storybook v6.0.20
See original GitHub issueI configured @storybook/web-components
HMR referring to Setup page reload via HMR
After upgrading v6.0.20
, this warning message was appeared.
configure()
is deprecated and will be removed in Storybook 7.0. Please use thestories
field ofmain.js
to load stories.
That’s why I wanna remove congiure()
from preview.js
!
If I removed configure()
, maybe it works normally.
const req = require.context('../src', true, /\.stories\.(js|mdx)$/);
if (module.hot) {
module.hot.accept(req.id, () => {
const currentLocationHref = window.location.href;
window.history.pushState(null, null, currentLocationHref);
window.location.reload();
});
}
Is it the correct way ? Or are there any alternative way ? Thank you !
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:14 (10 by maintainers)
Top Results From Across the Web
Hot Module Reload in web components storybook v6.0.20 ...
I configured @storybook/web-components HMR referring to Setup page reload via HMR After upgrading v6.0.20 , this warning message was appeared. configure() is ...
Read more >Development: Hot Module Replacement
Keeps track of web component definitions in your code, and updates them at runtime on change. This is faster than a full page...
Read more >Hot Module Reload - FAST design system
Hot Module Reload. Hot Module Replacement (HMR) allows your web components to be updated as you develop, without needing a full refresh of...
Read more >MIGRATION.md · Gitee 极速下载/storybook - Gitee.com
In 6.0 we deprecated the ability to split a kind's (component's) stories into multiple files because it was causing issues in hot module...
Read more >Untitled
Jai maa durga story, Om prakash rao wife name, Ambi toys bubble fish, ... Bolton high school ct website, 50 shades of grey...
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
By following web-components documantation you end up in a situation with both settings: ‘npx -p @storybook/cli sb init -t web_components’ creates main.js with stories config and in hot reload workaround instructions does not mention the need to remove main.js config.
If the workaround will stay for some time, a note in the documentation may be worth
As a temporary workaround, you should be able to continue using
configure
and ignore the warning for now. We need to sort this out in 6.x. @daKmoR can you help figure out the upgrade here?