Skip to content

Commit

Permalink
fix prod log
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jul 8, 2024
1 parent d100d89 commit 8dc5ab4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/next/src/server/app-render/create-error-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,11 @@ export function createErrorHandler({
// The error logger is currently not provided in the edge runtime.
// Use the exposed `__next_log_error__` instead.
// This will trace error traces to the original source code.

if (typeof __next_log_error__ === 'function') {
__next_log_error__(err)
} else if (!dev) {
console.error(err)
}
onReactStreamRenderError?.(err)
}
Expand Down

0 comments on commit 8dc5ab4

Please sign in to comment.