2.0: <A> click before hydration settles renders root <Loading> fallback mid-hydration and leaves the page unresponsive
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 50/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- playwright, typescript, vite
- Domaine
- frontend, testing-qa
Piste de recherche
Start with the App.tsx root Loading boundary and the deferred data patterns in routes/index.tsx and routes/insureds.tsx. Reproduce an immediate Playwright click before the root onSettled flag, then trace the router navigation and hydration behavior. Done means the early click no longer produces hydration-key-miss warnings, duplicate DOM, or an unresponsive page.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
With SSR and a root <Loading> boundary, a click on an <A> link that lands before hydration has settled is taken by the router, which starts a client-side navigation. The next route's data is not ready yet, so the root <Loading> fallback is rendered while the page is still hydrating. Hydration then fails to claim the server's DOM, and the page stops responding: the server-rendered content stays on screen, but no further clicks do anything.
Console output when it happens:
Hydration key miss for "170110": no server-rendered element carries this key (template: <main>Loading…). A detached element was created instead; its subtree will not appear in the document or become interactive.
Hydration completed with 8 unclaimed server-rendered node(s): <main ...>
In the DOM, the page is drawn twice: the unclaimed server-rendered <main> and a second client-rendered copy.
Your Example Website or App
No public repro, sorry: it is a private app. The relevant shape is small, though:
// App.tsx
export default function App() {
return (
<Router>
{(props) => (
<Loading fallback={<main>Loading…</main>}>
{props.children}
</Loading>
)}
</Router>
);
}
// routes/index.tsx: data read with deferStream
const landing = createMemo(() => getLanding(), { deferStream: true }); // getLanding = query(..., "landing")
// ...renders <A href="/insureds">Insureds</A>
// routes/insureds.tsx: its own query + deferStream, same pattern
Steps to Reproduce the Bug or Issue
- Server-render a page like the above (SSR, streaming, dev server).
- As soon as the server's content is visible, before hydration has settled, click an
<A>link to another route whose data is not cached. - The target route's data is fetched, the root
<Loading>fallback renders mid-hydration, and the hydration-key-miss warnings above appear. - The page no longer responds to clicks.
Driving this with Playwright (sign in, then click the link immediately when the heading is visible, with no wait), about 1 in 4 runs fail. If the test first waits for a flag set in onSettled at the root, it passes 40 out of 40.
Expected behavior
A click that arrives before hydration settles should not break hydration. For example, the router could ignore or queue it until hydration settles, or fall back to a normal full-page navigation.
Screenshots or Videos
No response
Platform
- OS: Linux (Arch, kernel 7.2)
- Browser: Chromium, via Playwright 1.63 (headless)
- Version:
@solidjs/router2.0.0-next.26,solid-js/@solidjs/web2.0.0-rc.9,@solidjs/vite-plugin3.0.0-next.44, Vite 8.3, Node 26
Additional context
- I could not check the latest (
@solidjs/router2.0.0-next.30 +solid-js2.0.0-rc.10): after upgrading, the app failed to load a route module (Failed to fetch dynamically imported module .../src/routes/index.tsx?pick=default&pick=$css), unrelated to this bug, so I could not run the repro there. - Possibly related, but a different trigger: solidjs/solid#3610 (hydrate starting before the records script).
- Workaround we use in tests: set an attribute on
<html>fromonSettledin a component inside the root<Loading>, and wait for it before interacting after each full page load.
- Langage dominant
- TypeScript
- Étoiles
- 1.3k
- Forks
- 184
- Merge moyen
- 15 h 47 min
- PR mergées (30 j)
- 47
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de solidjs/solid-router
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
solidjs/solid-router#696 ·
Les mainteneurs répondent en général sous 1 jour
-
1.x
Difficulté 4/5 1-2 jours Accessibilité débutants 57/100
solidjs/solid-router#694 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
solidjs/solid-router#691 ·
Les mainteneurs répondent en général sous 1 jour
-
Forward pressed while a Back navigation is still loading is dropped; the URL and the rendered route get out of syncPeut-être pris @sean0407 l’a pris il y a 8 jours. Ouverte1.x
Difficulté 4/5 1-2 jours Accessibilité débutants 54/100
solidjs/solid-router#687 ·
Les mainteneurs répondent en général sous 1 jour
-
<A> costs ~6us of server CPU per instance during SSR (20x a plain <a>), mostly mergeProps/splitPropsPeut-être pris @birkskyum l’a pris il y a 79 jours. Ouverte1.x
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
solidjs/solid-router#583 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de solidjs/solid-router
Issues similaires
-
comp/desktop desktop/shell os/windows P3 tool/file type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
NousResearch/hermes-agent#145928 ·
Les mainteneurs répondent en général sous 1 jour
-
compiler-dom: stringifyStatic renders :disabled="0" as a present attributePeut-être pris @DaZuiZui l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
vuejs/core#16051 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
-
integration:coding-agents
Difficulté 1/5 Moins d'une heure Accessibilité débutants 83/100
vectorize-io/hindsight#6151 ·
Les mainteneurs répondent en général sous 1 jour
-
DogFooding
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
OpenAEV-Platform/openaev#8768 ·
Les mainteneurs répondent en général sous 1 jour