2.0: <A> click before hydration settles renders root <Loading> fallback mid-hydration and leaves the page unresponsive
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 50/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- playwright, typescript, vite
- Lĩnh vực
- frontend, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.3k
- Fork
- 180
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 26
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid-router
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
solidjs/solid-router#633 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Query enumeration recomputes on pathname/hash-only navigation with unchanged search (Solid 2)Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
solidjs/solid-router#624 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
<A> costs ~6us of server CPU per instance during SSR (20x a plain <a>), mostly mergeProps/splitPropsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
solidjs/solid-router#583 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
solidjs/solid-router#569 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
solidjs/solid-router#518 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid-router
Issue tương tự
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Dream TR SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
SocialGouv/egapro#4672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:agents area:tui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anthropics/claude-code#98358 ·
Maintainer thường phản hồi trong vòng 1 ngày