cloudflare/vinext

App Router: `useSearchParams` / `searchParams` static-bailout to client rendering not implemented

已关闭

#1,524 创建于 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

Pages that read searchParams (server) or call useSearchParams() should bail out of the static prerender and render the params at request time. vinext renders the static shell only — the server component sees no search params, the client component never receives the value, and the Suspense fallback never appears in the prerendered HTML.

Expected: "Parameter: hello" Received: "Parameter: "
Expected string to include: "<p>search params suspense</p>"

Estimated Impact

~4 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/app-dir/searchparams-static-bailout/searchparams-static-bailout.test.ts (3 failures)
  • test/e2e/app-dir/app-static/app-static.test.ts

Recommendation

  1. Reproduce first in vinext's own test suite. Add a page that reads searchParams in a server component and a client component using useSearchParams(). Assert the static prerender shows the Suspense fallback and the dynamic render includes the values.

  2. Implement the static-bailout. When searchParams / useSearchParams() are read inside a prerendered component, bail out to dynamic rendering for the affected subtree and emit the Suspense fallback in the prerendered HTML.


Part of #1328.

贡献者指南