Pages Router: client bundle does not boot / hydration leaves SSR markup unreplaced
#1,457 opened on 2026/05/22
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
mainvs Next.jsv16.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
-
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. -
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. -
Wire the Pages Router client boot. Ensure the Pages Router entry imports
react-dom/client.hydrateRootand reads__NEXT_DATA__for initial props, mirroring.nextjs-ref/packages/next/src/client/index.tsx. -
Check
instrumentation-client.tsordering. Once hydration boots, also ensure theinstrumentation-client.tshook runs beforehydrateRoot()as required by the standalone failure.