Storybook: How to enable [HMR] console logging in 5.2

Created on 7 Oct 2019  路  10Comments  路  Source: storybookjs/storybook

I'm hesitant to upgrade from 5.1 to 5.2, as it appears Webpack's [HMR] console logging has been disabled. Can this be re-enabled through configuration?

I've tried creating ./.storybook/webpack.config.js with:

module.exports = async ({ config, mode }) => {
  config.devServer = { stats: "verbose" };
  return config;
};

...and an assortment of variations, but no change.

babel / webpack has workaround question / support

All 10 comments

@ndelangen any ideas?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

I haven't figured out the solution, but I believe I've tracked down what is causing the behavior. From what I can tell the devServer configuration is being passed to Webpack correctly, and the configuration goes to webpack-dev-middleware as intended. The issue is with webpack-hot-middleware though. It allows for a quiet property to be passed and currently it is being set with a true value, which is suppressing output.

https://github.com/storybookjs/storybook/blob/87e705dd50bb1b924163b88fc832e7f55f61f0b4/lib/core/src/server/dev-server.js#L119

https://github.com/webpack-contrib/webpack-hot-middleware

I hope this helps!

That's it! I'm not seeing an easy way to get to it through configuration, but in the line...

https://github.com/storybookjs/storybook/blob/a2a6b9d1663990e7450768985404f8eda652d162/lib/core/src/server/preview/preview-preset.js#L14-L16

...changing quiet=true to quiet=false enables the console output again. Thanks!

No problem. Glad you figured out!

Yo @eldewen will you be opening up a PR for bring the warnings back?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

poke stale bot, I'd still like to see this ticket addressed

@BPScott see #9535
@ndelangen can we close?

Yes, I think that resolves this issue.

Was this page helpful?
0 / 5 - 0 ratings