question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot Module Reload in web components storybook v6.0.20

See original GitHub issue

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 deprecated and will be removed in Storybook 7.0. Please use the stories field of main.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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
blikblumcommented, Dec 7, 2020

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

2reactions
shilmancommented, Oct 8, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found