Skip to content

Commit

Permalink
Deduplicate identical errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 28, 2017
1 parent 216efc7 commit 645dc42
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/react-error-overlay/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ export function startReportingRuntimeErrors(options: RuntimeReportingOptions) {
}

function handleRuntimeError(errorRecord) {
if (
currentRuntimeErrorRecords.some(({ error }) => error === errorRecord.error)
) {
// Deduplicate identical errors.
// This fixes https://github.com/facebookincubator/create-react-app/issues/3011.
return;
}
currentRuntimeErrorRecords = currentRuntimeErrorRecords.concat([errorRecord]);
update();
}
Expand Down

0 comments on commit 645dc42

Please sign in to comment.