cloudflare/vinext

Pages Router: client bundle does not boot / hydration leaves SSR markup unreplaced

Geschlossen

#1.457 geöffnet am 22.05.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (371 Forks)github user discovery
adapter-api-e2ehelp wanted

Repository-Metriken

Stars
 (8.563 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 1h) (462 gemergte PRs in 30 T)

Beschreibung

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-22).

Problem

After Pages Router SSR returns server-rendered HTML, the client never hydrates: text expected to flip from server to client loaded stays at server, and #query / #initial-query selectors never appear. This indicates the Pages Router client entry is missing or not booting in deploy mode. Related to the missing __NEXT_DATA__ script (see separate issue) and instrumentation-client.ts hook failures.

Expected pattern: /client loaded/ | Received: "server"
waiting for locator('#query') to be visible

Estimated Impact

~4 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/getserversideprops/test/index.test.ts (4 failures)

Recommendation

  1. Reproduce first in vinext's own test suite. Build a Pages Router gssp app in deploy mode and assert that a useEffect-driven text change happens after page load. Confirm the client script never runs.

  2. Confirm the client entry is emitted and referenced. Inspect the SSR HTML for <script src="_next/static/chunks/main-app..."> (or equivalent) and verify the browser actually fetches and executes it under deploy mode.

  3. Wire the Pages Router client boot. Ensure the Pages Router entry imports react-dom/client.hydrateRoot and reads __NEXT_DATA__ for initial props, mirroring .nextjs-ref/packages/next/src/client/index.tsx.

  4. Check instrumentation-client.ts ordering. Once hydration boots, also ensure the instrumentation-client.ts hook runs before hydrateRoot() as required by the standalone failure.

Contributor Guide