[PR #763] [MERGED] fix: pass thenable params and searchParams to probePage() #827

Closed
opened 2026-05-06 13:10:20 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/763
Author: @NathanDrake2406
Created: 4/3/2026
Status: Merged
Merged: 4/3/2026
Merged by: @james-elicx

Base: mainHead: fix/probe-page-thenable-params


📝 Commits (1)

  • 4816ece fix: pass thenable params and searchParams to probePage()

📊 Changes

6 files changed (+328 additions, -7 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+14 -1)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+84 -6)
📝 tests/app-page-probe.test.ts (+147 -0)
📝 tests/app-router.test.ts (+39 -0)
tests/fixtures/app-basic/app/probe-async-params/[id]/page.tsx (+23 -0)
tests/fixtures/app-basic/app/probe-async-search/page.tsx (+21 -0)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/763 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 4/3/2026 **Status:** ✅ Merged **Merged:** 4/3/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/probe-page-thenable-params` --- ### 📝 Commits (1) - [`4816ece`](https://github.com/cloudflare/vinext/commit/4816eceee0ae5058ecc4a2db9413d7d0f9d96d9f) fix: pass thenable params and searchParams to probePage() ### 📊 Changes **6 files changed** (+328 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+14 -1) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+84 -6) 📝 `tests/app-page-probe.test.ts` (+147 -0) 📝 `tests/app-router.test.ts` (+39 -0) ➕ `tests/fixtures/app-basic/app/probe-async-params/[id]/page.tsx` (+23 -0) ➕ `tests/fixtures/app-basic/app/probe-async-search/page.tsx` (+21 -0) </details> ### 📄 Description ## 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 - [x] Unit: probe detects `notFound()` from an async-params page when params are thenable - [x] Unit: probe detects `redirect()` from an async-searchParams page when searchParams are thenable - [x] Unit: probe silently fails when searchParams is omitted (documents the bug) - [x] Integration: page using `await params` then `notFound()` returns 404 - [x] Integration: page using `await searchParams` then `redirect()` returns 307 - [x] Integration: pages render normally with valid params/searchParams - [x] Entry template snapshots updated - [x] `tests/features.test.ts` — all 264 tests pass --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:20 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#827
No description provided.