Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -2046,24 +2046,17 @@ function customizeViewTransitionError(
error.message ===
'Skipping view transition because document visibility state has become hidden.' ||
error.message ===
'Skipping view transition because viewport size changed.'
'Skipping view transition because viewport size changed.' ||
// Chrome uses a generic error message instead of specific reasons. It will log a
// more specific reason in the console but the user might not look there.
// Some of these errors are important to surface like duplicate name errors but
// it's too noisy for unactionable cases like the document was hidden. Therefore,
// we hide all of them and hopefully it surfaces in another browser.
error.message === 'Transition was aborted because of invalid state'
) {
// Skip logging this. This is not considered an error.
return null;
}
if (__DEV__) {
if (
error.message === 'Transition was aborted because of invalid state'
) {
// Chrome doesn't include the reason in the message but logs it in the console..
// Redirect the user to look there.
// eslint-disable-next-line react-internal/prod-error-codes
return new Error(
'A ViewTransition could not start. See the console for more details.',
{cause: error},
);
}
}
break;
}
}
Expand Down
Loading