Skip to content

Bug: Transition was aborted because of invalid state when browser tab not active #34098

@widavies

Description

@widavies

React version: 19.1.1

Steps To Reproduce

  1. Call document.startViewTransition when the browser tab is not active/visible
  2. Go back/select the browser tab - a ViewTransition error was thrown
Image Image Image

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 InvalidStateErrors, and surfaces the error here:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions