[solid-router] errorComponent is SSR'd inside MatchInner but hydrated from CatchBoundary's Errored fallback — hydration key miss, error UI never interactive
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
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Comienza con packages/solid-router/src/Match.tsx y sigue la rama de error citada a través de CatchBoundary y Errored. Ejecuta el reproductor enlazado con check.mjs para observar la ausencia de la clave de hidratación y el botón inactivo; se considera terminado cuando el componente de error se hidrata sin advertencias y sus controles visibles funcionan, igual que en la ruta de control.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which project does this relate to? Router
Describe the bug
In @tanstack/solid-router, a route whose loader throws gets its errorComponent instantiated at two different points in the component tree depending on the side. MatchInner's status === 'error' branch (packages/solid-router/src/Match.tsx) renders the error component inline on the server, as a child of its own <Solid.Match>, but throws on the client, so CatchBoundary's <Solid.Errored> catches it and renders the error component from its fallback, several levels higher:
<Solid.Match when={currentMatch().status === 'error'}>
{(_) => {
if (isServer ?? router.isServer) {
const RouteErrorComponent =
(route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent
return <RouteErrorComponent error={currentMatch().error} info={{ componentStack: '' }} />
}
throw currentMatch().error
}}
</Solid.Match>
Solid hydration is id-addressed, and the two sides mint the error component's ids under different namespaces — server: Match → CatchBoundary → Errored → Show → RouteContent → … → MatchInner → Show → Switch → Match; client: Match → CatchBoundary → Errored. The client's root element therefore names a key no server element carries. @solidjs/web logs Hydration key miss and builds the client copy detached; the server's copy stays in the document, unclaimed, with the markup the user sees and no event listeners. Any control inside an error component is dead after hydration. A one-element error component (a bare <h1>) looks fine, because nothing in it needed wiring — which is how this stays invisible until someone puts a button in one.
From the reproducer, the server id, the client's missed claim, and — for comparison — the id the same component gets when rendered from the route's normal component:
server …0004900010002 1011032370000 ← MatchInner renders <RouteErrorComponent> inline
client …0004900010002 200100 ← <Errored fallback> instantiates it at the CatchBoundary
control …0004900010002 1032371102 ← MatchInner's success branch
The React router has the same server/client split and gets away with it because React reconciles by tree position and re-renders on a mismatch; Solid does neither.
Complete minimal reproducer
https://github.com/TylerRick/tanstack-solid-router-error-component-hydration-repro
Steps to Reproduce the Bug
pnpm install && pnpm dev, thennpx playwright install chromiumonce andnode check.mjs(or openhttp://localhost:5602and click the button by hand)./is the subject: the loader throws synchronously; the route'serrorComponentrenders a<Card>component — a heading, a#countspan, and a#bumpbutton that increments it./controlrenders the identical<Card>from the route'scomponent. (/show,/async, and/elementvary the error component's root and the loader's timing; they behave the same.)check.mjsloads each route, collects console output, and clicks the visible#bump:
--- SUBJECT (component-rooted errorComponent)
hydration messages: 2
[warning] Hydration key miss for "0000010101149a001000210323711620004900010002200100": no server-rendered
element carries this key (template: <section id=card …). A detached element was created instead…
[warning] Hydration completed with 1 unclaimed server-rendered node(s):
<section _hk="0000010101149a0010002103237116200049000100021011032370000" id="card" …
#count after clicking the visible #bump: ["0"]
visible button wired: false
--- CONTROL (same Card via the route component)
hydration messages: 0
#count after clicking the visible #bump: ["1"]
visible button wired: true
Expected behavior
The error component hydrates: no key miss, and its controls work after hydration — the same as the identical component rendered from component. That needs the error component to be instantiated from ONE place on both sides; whether that is the server also throwing into <Errored>, or the client rendering inline as the server does (with reset passed through context rather than the boundary), is your call.
Screenshots or Videos
n/a — check.mjs output above.
Platform
@tanstack/solid-router2.0.0-rc.4,@tanstack/solid-start2.0.0-rc.4,@tanstack/router-core1.171.22 — theMatch.tsxbranch quoted above is unchanged onmaintodaysolid-js/@solidjs/web2.0.0-rc.6- OS: Linux
- Browser: Chromium (Playwright 1.62.1), 151.0.7922.34
- Bundler: Vite 8.2.2,
vite-plugin-solid3.0.0-next.27
Additional context
Found in a TanStack Start app while giving a route an errorComponent with a "sign out and retry" button for its 403: the button rendered and did nothing. The app's default error component is a lone <h1>, which is why the key miss had been sitting in our logs as harmless. In that app the detached client copy was also inserted into the page next to the server's (the error UI rendered twice); the reproducer shows the key miss and the dead button but holds one copy, so I have not isolated what the duplicate needs.
- Lenguaje dominante
- TypeScript
- Estrellas
- 15.3k
- Forks
- 1.9k
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 46
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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 TanStack/router
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')Posiblemente ocupada @hassanabrar202 la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)Posiblemente ocupada @Sheraff la tomó hace 27 días. Abiertopackage: router-generator performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiersPosiblemente ocupada @Sheraff la tomó hace 27 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
docs(router): clarify static title fallback in SPA modePosiblemente ocupada @Rohan-Dedhia la tomó hace 17 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/router
Issues similares
-
[BUG]: Shared links drop the configured basePath on GitHub PagesPosiblemente ocupada @anshulchikhale30-p la tomó hoy. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add: GTrekkerAbiertocheck:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
Los mantenedores suelen responder en 1 día
-
area: ui Bug Payload OSS
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
payloadcms/payload#19839 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
Los mantenedores suelen responder en 1 día