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

fix: don't break joi validation for production bundles webpack errors #15602

Merged
merged 3 commits into from
Jul 10, 2019

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Jul 10, 2019

Two things tackled here:

  • reporter.error doesn't handle (message: string, errors: Array) signature
  • Converting production webpack errors to structured ones (in development we don't handle displaying errors - it's handled by FriendlyErrorsWebpackPlugin currently). For now it's generic error, but later will probably expand and we could clone FriendlyErrorsWebpackPlugin error handling and swap development to use our errors (and enable clearing console from fixed errors and only display ones that are not fixed yet)

Example output:
Screenshot 2019-07-10 at 16 32 40
Screenshot 2019-07-10 at 17 20 53

Question - should webpack compilation errors in build-javascript and build-html share same ids? For now it would be easy separate them as we have single generic webpack error id, but if add more specific ones for some cases, this might be messy.

Partially fixes #15242

@pieh pieh requested a review from a team as a code owner July 10, 2019 15:20
Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

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

🌮 looks great! 🌮

@wardpeet wardpeet merged commit 4c50024 into gatsbyjs:master Jul 10, 2019
@m-allanson m-allanson deleted the prod-webpack-error-handling branch July 16, 2019 09:10
@pieh pieh restored the prod-webpack-error-handling branch May 17, 2020 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

construct-error.js - child "error" fails because ["error" must be an object]
2 participants