Bug: hidden-document InvalidStateError from ViewTransition is reported again on Chrome 153+ (message now carries a reason suffix)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, react
- Área
- frontend
Línea de trabajo
Comienza en packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js, en customizeViewTransitionError, e inspecciona las comparaciones de mensajes existentes. Reproduce el caso determinista de DOMException, añade cobertura para el sufijo de reason de Chrome y la redacción de Firefox para documentos ocultos, y verifica que los saltos para documentos ocultos sigan suprimidos mientras que los errores no relacionados sigan notificándose.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
React version: 19.3.0 (also 19.3.0-canary-59aff3e1-20260918, 0.0.0-experimental-59aff3e1-20260918, and the canary vendored in Next.js 16.3.5)
Summary
customizeViewTransitionError in packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js suppresses the InvalidStateError a browser raises when a view transition is skipped on a hidden document, but only by exact message equality. Since Chrome/Edge 153 (stable 2026-09-08) Blink appends the skip reason to the generic message, so the comparison fails and the error is passed to onRecoverableError on every skipped transition in a background tab. Firefox's wording was never in the list.
Messages observed in production:
Transition was aborted because of invalid state. Document hidden(Chrome/Edge 153)Transition was aborted because of invalid state. Viewport size changed(Chrome/Edge 153)Transition was aborted because of invalid state(Chrome/Edge ≤ 152, suppressed today)Skipped ViewTransition due to document being hidden(Firefox 153–156, not suppressed)
Blink builds the string as prefix + skip reason (FormatExceptionMessage in dom_view_transition.cc), and on a hidden document only ready rejects, so the rejection goes through React's handler and the equality check is the only thing deciding suppress vs report. In one production app this went from zero to about 240 sessions/week starting 2026-09-09.
Steps to reproduce
Real browser: render a <ViewTransition> whose update is triggered by a timer, switch to another tab before it fires, come back. On Chrome 153 onRecoverableError receives the DOMException; on ≤ 152 nothing is reported.
Deterministic, browser-independent (this is how I verified 19.3.0):
// before React loads: mimic Chromium's DidSkipTransition for a hidden document
const msg = "Transition was aborted because of invalid state. Document hidden";
document.startViewTransition = (opts) => {
const update = typeof opts === "function" ? opts : opts.update;
const updateDone = Promise.resolve().then(() => update());
return { ready: Promise.reject(new DOMException(msg, "InvalidStateError")),
finished: updateDone.then(() => undefined), updateCallbackDone: updateDone,
skipTransition() {}, types: new Set() };
};
// then: createRoot(el, { onRecoverableError: console.error }) rendering a <ViewTransition>
// updated inside startTransition every second
Result with react-dom 19.3.0: the bare message logs nothing; the ". Document hidden" message and the Firefox message reach onRecoverableError on every transition.
Current behavior
Every skipped transition in a background tab surfaces as a recoverable error on Chrome/Edge 153+ and Firefox, which frameworks forward to reportError and error trackers record as a crash.
Expected behavior
The hidden-document skip stays suppressed as it was on Chrome ≤ 152. Suggested fix: match the Chrome prefix (error.message.startsWith("Transition was aborted because of invalid state")) and add Firefox's "Skipped ViewTransition due to document being hidden". Happy to open a PR.
- Lenguaje dominante
- JavaScript
- Estrellas
- 251k
- Forks
- 51.4k
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 51
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/react
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Todos los issues de react/react
Issues similares
-
ai-observability bug team/ai-observability
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AllTheMods/ATM-10-L#19 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
SignalK/n2k-signalk#345 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
JuliaPluto/PlutoPlotly.jl#72 ·