nextjs - 💡(How to fix) Fix [Next.js 16] [App Router] searchParams empty on statically generated pages when Draft Mode is enabled (Vercel only)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Enterprise
  Available memory (MB): 32213
  Available CPU cores: 16
Binaries:
  Node: 22.22.0
  npm: 10.9.4
  Yarn: 4.12.0
  pnpm: 10.33.0
Relevant Packages:
  next: 16.2.1-canary.29 // Latest available version is detected (16.2.1-canary.29).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/illiakovalenko/app-router-draft-mode-proxy-bug

To Reproduce

  1. Deploy application to Vercel
  2. Visit <host>/api/render url

Current vs. Expected behavior

Current behaviour

I followed the documentation for draftMode and want to pass search parameters via redirect and access them on the page after I hit the route handler: https://nextjs.org/docs/app/guides/draft-mode#step-2-access-the-route-handler-from-your-headless-cms

On Next.js App Router v16 deployed to Vercel, searchParams are empty on a statically generated page, even when Draft Mode is enabled. The same setup works correctly on Next.js 15. This issue does not occur locally with next dev or next start - it only happens on Vercel production deployments.

The route handler redirects to: /test?language=en&timestamp=1775717500894

<img width="200" height="78" alt="Image" src="https://github.com/user-attachments/assets/92f0aa9d-3633-4122-bf6e-21c517739654" />

Expected behaviour

When Draft Mode is enabled, the page should receive the full searchParams object, even if the route is statically generated. This allows the page to remain static (SSG) for normal traffic while switching to dynamic preview behavior in Draft Mode.

<img width="789" height="157" alt="Image" src="https://github.com/user-attachments/assets/8ed36d05-da5e-4b6f-9514-4b8d5114c4cf" />

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Enterprise
  Available memory (MB): 32213
  Available CPU cores: 16
Binaries:
  Node: 22.22.0
  npm: 10.9.4
  Yarn: 4.12.0
  pnpm: 10.33.0
Relevant Packages:
  next: 16.2.1-canary.29 // Latest available version is detected (16.2.1-canary.29).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Draft Mode, Dynamic Routes

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

I tested this using Next.js 15, and it becomes reproducible in Next.js 16. The issue is reproducible when deployed to Vercel, but it does not occur locally.

extent analysis

TL;DR

  • The issue with empty searchParams on statically generated pages in Next.js App Router v16 on Vercel production deployments may be resolved by checking the configuration of draftMode and the redirect handling in the route handler.

Guidance

  • Verify that the draftMode configuration is correctly set up according to the Next.js documentation, ensuring that it is enabled and properly integrated with the route handler.
  • Check the redirect handling in the route handler to ensure that it correctly passes the search parameters to the statically generated page.
  • Compare the differences in behavior between Next.js 15 and 16 to identify potential changes in draftMode or redirect handling that may be causing the issue.
  • Test the application locally with next dev or next start to confirm that the issue is specific to Vercel production deployments.

Example

  • No specific code example can be provided without more information about the route handler and draftMode configuration.

Notes

  • The issue seems to be specific to Vercel production deployments and does not occur locally, which may indicate a configuration or environment-related issue.
  • The difference in behavior between Next.js 15 and 16 suggests that there may be changes in draftMode or redirect handling that need to be accounted for.

Recommendation

  • Apply workaround: Check the draftMode configuration and redirect handling in the route handler to ensure correct integration and search parameter passing, as the issue may be related to changes in Next.js 16 or Vercel deployment configuration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING