next.js
45a328a8 - avoid logging stacks for internal errors (#71575)

Commit
1 year ago
avoid logging stacks for internal errors (#71575) `NEXT_PAGE_EXPORT_ERROR` and `NEXT_STATIC_GEN_BAILOUT` shouldn't show up in failed build logs as they'll point to an internal stack not related to user code. This updates the code that throws the `ExportPageError` to instead exit the worker when `prerenderEarlyExit` is true (which is the default) so that the page export error doesn't leak into the outer error handler which is meant for user errors. For static generation bailout errors, we'll log the error message (if it exists) otherwise there's nothing to log as the stack would point to internal framework code. This also removes a redundant log that is already printed as a prerender error.
Author
Parents
Loading