Skip to content

Commit 645dc42

Browse files
committed
Deduplicate identical errors
1 parent 216efc7 commit 645dc42

File tree

1 file changed

+7
-0
lines changed
  • packages/react-error-overlay/src

1 file changed

+7
-0
lines changed

packages/react-error-overlay/src/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ export function startReportingRuntimeErrors(options: RuntimeReportingOptions) {
5959
}
6060

6161
function handleRuntimeError(errorRecord) {
62+
if (
63+
currentRuntimeErrorRecords.some(({ error }) => error === errorRecord.error)
64+
) {
65+
// Deduplicate identical errors.
66+
// This fixes https://github.com/facebookincubator/create-react-app/issues/3011.
67+
return;
68+
}
6269
currentRuntimeErrorRecords = currentRuntimeErrorRecords.concat([errorRecord]);
6370
update();
6471
}

0 commit comments

Comments
 (0)