cloudflare/vinext

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

已关闭

#1,457 创建于 2026年5月22日

 (0 条评论) (0 个反应) (0 位负责人)TypeScript (384 个派生)github user discovery
adapter-api-e2ehelp wanted

仓库指标

星标
 (8,625 个星标)
PR 合并指标
 (平均合并 1天 1小时) (30 天内合并 462 个 PR)

描述

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.

贡献者指南