diff --git a/packages/next/src/client/components/react-dev-overlay/ui/container/runtime-error/render-error.tsx b/packages/next/src/client/components/react-dev-overlay/ui/container/runtime-error/render-error.tsx index dcdf38d4072f5..85223a9eafdc4 100644 --- a/packages/next/src/client/components/react-dev-overlay/ui/container/runtime-error/render-error.tsx +++ b/packages/next/src/client/components/react-dev-overlay/ui/container/runtime-error/render-error.tsx @@ -108,7 +108,12 @@ const RenderRuntimeError = ({ children, state, isAppDir }: Props) => { } }, [nextError, isAppDir]) - const totalErrorCount = runtimeErrors.length + const totalErrorCount = errors.filter((err, idx) => { + const prev = errors[idx - 1] + // Check for duplicates + if (idx > 0) return getErrorSignature(prev) !== getErrorSignature(err) + return true + }).length return children({ runtimeErrors, totalErrorCount }) }