Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 24, 2024
1 parent b7bf8c8 commit bd0f147
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/next/src/client/app-index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ import { HMR_ACTIONS_SENT_TO_BROWSER } from '../server/dev/hot-reloader-types'
// Since React doesn't call onerror for errors caught in error boundaries.
const origConsoleError = window.console.error
window.console.error = (...args) => {
// error is the second argument to `console.error`: https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78
if (isNextRouterError(args[1])) {
// See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78
if (
process.env.NODE_ENV !== 'production'
? isNextRouterError(args[1])
: isNextRouterError(args[0])
) {
return
}
origConsoleError.apply(window.console, args)
Expand Down

0 comments on commit bd0f147

Please sign in to comment.