AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

SearchParams Empty On Statically Generated Pages With Draft Mode Enabled On Vercel (Next.Js 16 Regression)

In Next.js 16 (canary) with App Router, when Draft Mode is enabled and a route handler redirects to a statically generated page with query parameters, the page receives an empty searchParams object. This only occurs on Vercel production deployments; local dev and next start work fine. Next.js 15 behaves as expected.

highConfidence 75%Next.jsReact Server ComponentsRoute HandlersAffected V16.2.1-Canary.29

Origin Analysis

A regression in Next.js 16's static generation / draft mode integration likely causes query parameters to be stripped or not forwarded to page props when the page is statically cached and later served in Draft Mode, especially under Vercel's serverless environment.
1. Deploy an App Router app to Vercel with a statically generated page (e.g., /test) that reads searchParams. 2. Create an API route handler that enables Draft Mode and redirects to /test?language=en&timestamp=... 3. Visit the route handler URL. 4. Observe that on the /test page, searchParams is empty instead of containing the query parameters.

Fixing Code Block

Edge Case Audit

This fix depends on the Vercel-specific 'x-forwarded-uri' header, which may not be present in all environments or could change in future Vercel updates. It also ignores potential duplicate or encoded parameters and does not address the underlying Next.js bug. Use only as a temporary patch until an official fix is released. When upgrading Next.js, remove this workaround and re-test. Rollback: simply replace 'params' with the original 'searchParams' prop and remove the parsing logic.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state