Page freezes when a Suspense boundary suspends again while retrying hydration

Abierto
#137 6 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Start by tracing renderSuspense, hydrateSuspenseBoundary, recoverBoundaryHydration, and realHandleSuspended through the retry path described in the issue. Then find the existing hydration and Suspense tests and add coverage for a child suspending during boundary recovery. Done means the pending promise is retried without a repeated microtask loop and the page becomes responsive.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi! I had a try using Redact and intlayer webapps and the homepage froze on load.

Chrome showed the "Page unresponsive" dialog. With plain React 19 the same build works fine. Changing the feature flags didn't help (redact(), or redact({ features: { ... } })).

After some digging in an unminified build, the console was full of the bare Error() that flushPending throws after 50 passes. It fires over and over, and the microtask loop never gives the main thread back.

What seems to happen:

  1. The landing page sits in a server-rendered <Suspense>. Its content suspends during the first hydration (our dictionaries load lazily), so the boundary gets w set and retryHydration waits on the promise. All good so far.
  2. When it retries (renderSuspense, the state.w && state.b && state.e branch), the markup no longer matches the server, so hydrateSuspenseBoundary falls back to recoverBoundaryHydration. That client-renders with root.h = false.
  3. A child suspends during that client render. suspendHandler isn't set on this path, so realHandleSuspended throws a RenderSuspenseCapture, and the capture doesn't carry the promise.
  4. The catch in that branch only calls retryHydration for thenables, so the capture is rethrown. renderUpdates then reschedules the boundary right away, the child suspends on the same pending promise, and it goes round again.

Versions:
-@tanstack/redact 0.2.5,

  • Vite 8.3.5,
  • @tanstack/react-start 1.169.
Lenguaje dominante
TypeScript
Estrellas
640
Forks
32
Merge medio
1 h 15 min
PR fusionados (30 d)
7

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/redact

Todos los issues de TanStack/redact

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.