Skip to content

fix: pass thenable params and searchParams to probePage()#763

Open
NathanDrake2406 wants to merge 1 commit intocloudflare:mainfrom
NathanDrake2406:fix/probe-page-thenable-params
Open

fix: pass thenable params and searchParams to probePage()#763
NathanDrake2406 wants to merge 1 commit intocloudflare:mainfrom
NathanDrake2406:fix/probe-page-thenable-params

Conversation

@NathanDrake2406
Copy link
Copy Markdown
Contributor

Summary

  • probePage() passed raw null-prototype params instead of thenable params, causing TypeError for pages using await params (Next.js 15+ pattern)
  • The probe also omitted searchParams, causing pages using await searchParams to fail
  • Both issues silently defeated the probe's purpose (early notFound()/redirect() detection)
  • The layout probe already used thenable params correctly — only the page probe was inconsistent

The fix computes _asyncSearchParams (URLSearchParams converted to a plain object then wrapped in makeThenableParams()) alongside _asyncLayoutParams, and passes both to the probePage() callback — matching the same prop shape that buildPageElement() gives to the real render.

Test plan

  • Unit: probe detects notFound() from an async-params page when params are thenable
  • Unit: probe detects redirect() from an async-searchParams page when searchParams are thenable
  • Unit: probe silently fails when searchParams is omitted (documents the bug)
  • Integration: page using await params then notFound() returns 404
  • Integration: page using await searchParams then redirect() returns 307
  • Integration: pages render normally with valid params/searchParams
  • Entry template snapshots updated
  • tests/features.test.ts — all 264 tests pass

probePage() passed raw null-prototype params instead of thenable params,
causing TypeError for any page using the Next.js 15+ async params pattern
(await params). The probe also omitted searchParams entirely. Both issues
caused the probe to silently fail, defeating its purpose of early notFound()
and redirect() detection. The layout probe already used the correct thenable
params — the page probe was the only inconsistent path.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@763

commit: 4816ece

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant