cloudflare/vinext

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

クローズ

#1,457 opened on 2026/05/22

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (371 件のフォーク)github user discovery
adapter-api-e2ehelp wanted

Repository metrics

Stars
 (8,563 個のスター)
PR merge metrics
 (平均マージ 1d 1h) (30d で 462 merged PRs)

説明

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.

コントリビューターガイド