-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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(gatsby): Pass reporter from functions code for reporting warning #31336
Conversation
Also include the file that the warning is for in the message
@@ -148,7 +148,9 @@ export const reportWebpackWarnings = ( | |||
warnings: StatsCompilation["warnings"] = [], | |||
reporter: Reporter | |||
): void => { | |||
const warningMessages = warnings.map(warning => warning.message) | |||
const warningMessages = warnings.map( | |||
warning => `${warning.moduleName}\n\n${warning.message}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatWebpackMessages does more than formatting. It also rewrites errors to a more actionable ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stats warnings/error object changed in v5 — see #30801 & facebook/create-react-app#9943
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but yeah, to your point, the message rewritings should still apply so we still want it
Co-authored-by: Ward Peeters <[email protected]>
…31336) * fix(gatsby): Pass reporter from functions code for reporting warning Also include the file that the warning is for in the message * Update packages/gatsby/src/internal-plugins/functions/gatsby-node.ts Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: Ward Peeters <[email protected]> (cherry picked from commit f09fae8)
…31336) (#31363) * fix(gatsby): Pass reporter from functions code for reporting warning Also include the file that the warning is for in the message * Update packages/gatsby/src/internal-plugins/functions/gatsby-node.ts Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: Ward Peeters <[email protected]> (cherry picked from commit f09fae8) Co-authored-by: Kyle Mathews <[email protected]>
…31336) * fix(gatsby): Pass reporter from functions code for reporting warning Also include the file that the warning is for in the message * Update packages/gatsby/src/internal-plugins/functions/gatsby-node.ts Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: Ward Peeters <[email protected]>
Also include the file that the warning is for in the message.
Fix for #30735 (comment)