Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable "--display-error-details" in webpack #6596

Closed
munerf opened this issue Apr 23, 2019 · 6 comments
Closed

Enable "--display-error-details" in webpack #6596

munerf opened this issue Apr 23, 2019 · 6 comments

Comments

@munerf
Copy link

munerf commented Apr 23, 2019

Is your feature request related to a problem? Please describe.
To debug module imports I would like to enable webpack's "--display-error-details" inside storybook!

Describe the solution you'd like
How can I do it?

@ndelangen
Copy link
Member

@shilman added a --debug-webpack options recently, perhaps we can add this setting when that is active?

@stale stale bot removed the inactive label May 16, 2019
@stale stale bot added the inactive label Jun 6, 2019
@stale stale bot removed the inactive label Jun 12, 2019
@storybookjs storybookjs deleted a comment from stale bot Jun 12, 2019
@storybookjs storybookjs deleted a comment from stale bot Jun 12, 2019
@ndelangen
Copy link
Member

If this flag is toggle-able from the webpack config, this should be fairly simple to implement, any takers?

@jamieshark
Copy link

Hi there! I think you can enable this webpack setting through the stats property in a custom config. Based on the default webpack config, it doesn't look like there are any default settings for stats, so we can assign that as a property on the default config and return it as a new custom config.

  1. Create a .storybook/webpack.config.js file.
  2. Add the stats option in your webpack config.
// .storybook/webpack.config.js
module.exports = async ({ config, mode }) => {
  config.stats = {
    errorDetails: true, // --display-error-details
  }
  return config;
};

Let me know if this works for your use case!

@dhuang612
Copy link
Contributor

Hi,

I would like to take this on!

@dhuang612
Copy link
Contributor

dhuang612 commented Oct 9, 2019

Hi,

I am pretty new to webpack. I've done some research into how to setup this via stats
https://webpack.js.org/configuration/stats/#statserrordetails

The files I see related to Webpack in this project are under
lib > core > src > server > preview
with the two files being:
base-webpack.config.js custom-webpack-preset.js
But then I also see a dev-server.js file.

Edit
under src/client/manager
I see a file called conditional-polyfills.js which seems to add in the ability to do polyfills.
Do I add a webpack.config.js file with --display-error-details set to true
to get this feature enabled?

Could I get some help on how I'm supposed to approach this?
created PR #8391 as a starting point

Thanks!

@sakit0
Copy link
Contributor

sakit0 commented Feb 4, 2020

@shilman
This fixed #8391 Issue.
I think you can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants