Skip to content

Commit

Permalink
ensure error is still logged
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Apr 15, 2021
1 parent 73a35ae commit bfb81fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/next/next-server/server/next-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,9 @@ export default class Server {
throw maybeFallbackError
}
} catch (renderToHtmlError) {
console.error(renderToHtmlError)
res.statusCode = 500

if (this.renderOpts.dev) {
const fallbackResult = await loadDefaultErrorComponents(this.distDir)
return this.renderToHTMLWithComponents(
Expand All @@ -2034,8 +2037,6 @@ export default class Server {
}
)
}
console.error(renderToHtmlError)
res.statusCode = 500
html = 'Internal Server Error'
}
return html
Expand Down

0 comments on commit bfb81fa

Please sign in to comment.