-
Notifications
You must be signed in to change notification settings - Fork 49.1k
Description
React version: 19.1.1
Steps To Reproduce
- Call
document.startViewTransition
when the browser tab is not active/visible - Go back/select the browser tab - a
ViewTransition
error was thrown



I can provide a repro if necessary, but I think this is fairly straightforward.
- According to the ViewTransition spec, this error is thrown when the document is not visible, as observed above (source)
react-dom
does not ignore all InvalidStateError
s, and surfaces the error here:
error.message === 'Transition was aborted because of invalid state'
Curiously, the error.message
is Transition was aborted because of invalid state
and not View transition was skipped because document visibility state is hidden.
. This error was obviously caused by the document not being visible, so it seems Chrome is not returning the proper message here, or something else is going on.
It seems like Chrome may not be returning the proper error.message
where it should be.
The way I see this, we could either file a ticket in Chromium or figure out an alternative way in react-dom to detect if InvalidStateError
occurred when the document wasn't visible and ignore it in