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

Enabled error details webpack #8391

Merged
merged 1 commit into from Oct 18, 2019

Conversation

dhuang612
Copy link
Contributor

Issue:
enable verbose errors within webpack

What I did

added in the configuration to manager.webpack.configure

How to test

no additional tests should be needed

@vercel
Copy link

vercel bot commented Oct 11, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/e8znz0vti
🌍 Preview: https://monorepo-git-fork-dhuang612-enabled-errordetails-webpack.storybook.now.sh

@shilman
Copy link
Member

shilman commented Oct 11, 2019

@dhuang612 thanks for putting this together! unfortunately, we're getting the following errors in CI. can you please take a look?

ERR! WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
ERR!  - configuration.module has an unknown property 'stats'. These properties are valid:
ERR!    object { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
ERR!    -> Options affecting the normal modules (`NormalModuleFactory`).
ERR!     at webpack (/tmp/storybook/node_modules/webpack/lib/webpack.js:31:9)
ERR!     at Promise (/tmp/storybook/lib/core/dist/server/dev-server.js:69:28)
ERR!     at new Promise (<anonymous>)
ERR!     at managerPromise.then.config (/tmp/storybook/lib/core/dist/server/dev-server.js:68:12)
ERR!  WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
ERR!  - configuration.module has an unknown property 'stats'. These properties are valid:
ERR!    object { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
ERR!    -> Options affecting the normal modules (`NormalModuleFactory`).
ERR!     at webpack (/tmp/storybook/node_modules/webpack/lib/webpack.js:31:9)
ERR!     at Promise (/tmp/storybook/lib/core/dist/server/dev-server.js:69:28)
ERR!     at new Promise (<anonymous>)
ERR!     at managerPromise.then.config (/tmp/storybook/lib/core/dist/server/dev-server.js:68:12)

@dhuang612
Copy link
Contributor Author

dhuang612 commented Oct 13, 2019

Hey,

Yes I'll work on this over this next week.

For next steps, I saw this comment saying:

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

Is this where I enable this setting?

@dhuang612
Copy link
Contributor Author

@shilman made changes to resolve errors

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This LGTM. @ndelangen?

added configuration change to manager-webpack.config

enabled display error details feature

added in configuration change to stats
@dhuang612
Copy link
Contributor Author

awesome!
I squashed the extra commits and re-pushed.
Thanks!

@@ -53,6 +53,7 @@ export default function(options) {
error.error = err;
error.close = true;
error.stats = stats;
stats.toJson(options.errorDetails);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only change?

Could you please explain what exactly this does?

Copy link
Contributor Author

@dhuang612 dhuang612 Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's enabling the option errorDetails through the function toJson.
So if the managerConfig has an error it will provide information about the error
https://webpack.js.org/api/node/#statstojsonoptions

Copy link
Member

@ndelangen ndelangen Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does stats.toJson have side effects?
or does it mutate the given options.errorDetails
or does it mutate the stats object itself?
?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it mutates the given options.errorDetails

@ndelangen ndelangen merged commit e86cbac into storybookjs:next Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants