Skip to content

fix(pages): preserve prerender rewrite query parity - #2218

Open
james-elicx wants to merge 17 commits into
mainfrom
codex/fix-pages-prerender-parity
Open

fix(pages): preserve prerender rewrite query parity#2218
james-elicx wants to merge 17 commits into
mainfrom
codex/fix-pages-prerender-parity

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Summary

  • match Next.js Pages Router readiness by hiding prerendered URL search params until hydration completes when rewrites may affect the initial route
  • preserve server-resolved rewrite query ownership across hydration, client push/replace, hash navigation, and browser history traversal
  • safely transport resolved query metadata through GSP/GSSP responses without allowing user headers or prototype keys to corrupt it
  • cover static, dynamic, optional catch-all, middleware-cleared, same-path rewrite, GSP, and GSSP cases in vinext-owned fixtures

Next.js parity references

Targeted local validation

  • vp test run tests/query.test.ts — 25 passed
  • targeted tests/pages-router.test.ts prerender/rewrite assertions
  • targeted tests/shims.test.ts Pages Router readiness, query ownership, navigation, hash, and history assertions
  • targeted tests/e2e/pages-router/prerender-rewrite-query.spec.ts assertions with one Playwright worker
  • targeted tests/e2e/pages-router-prod/prerender-rewrite-query.spec.ts assertions with one Playwright worker
  • focused format, lint, and type checks

No full local suite or raw Next.js E2E was run.

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@pkg-pr-new

pkg-pr-new Bot commented Jun 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2218
npm i https://pkg.pr.new/vinext@2218

commit: 180cd48

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
workers-cache preview production
web preview production

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 180cd48 against base 82d5f76 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 132.8 KB 133.4 KB ⚫ +0.5%
Client entry size (gzip) vinext 118.7 KB 118.7 KB ⚫ +0.0%
Dev server cold start vinext 2.44 s 2.41 s ⚫ -1.3%
Production build time vinext 3.03 s 3.05 s ⚫ +0.6%
RSC entry closure size (gzip) vinext 92.2 KB 92.2 KB ⚫ -0.0%
Server bundle size (gzip) vinext 166.9 KB 167.1 KB ⚫ +0.1%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

@james-elicx Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: prerender rewrite query parity (#2218)

Solid, well-tested change overall — the server→client query-ownership transport, prototype-pollution-safe setOwnQueryValue, and the header-spoofing guard (x-vinext-resolved-query is stripped from user headers before being re-set) are all correct, and the fix is wired consistently across dev (index.tsdev-server.ts), prod (prod-server.ts), and worker (deploy.ts) paths. But there is one blocking issue.

Blocking: a test added by this PR fails

tests/shims.test.ts"stamps initial router state without dropping third-party history fields" fails:

Tests  1 failed | 1145 passed
expected { analyticsEntry: 'landing', … } to deeply equal ObjectContaining{ __N: true, __vinext_queryOwner: "server", url: "/", as: "/", … }

This will fail the required Vitest check.

The cause is a mismatch between the new docstring/intent and the implementation in stampInitialHistoryState (packages/vinext/src/shims/router.ts:813). The docstring now says it should "preserve fields owned by userland or third-party history integrations while ensuring the router metadata needed for back/forward and query ownership is present", and the test sets a foreign initial history.state ({ analyticsEntry, nested }) and expects router metadata (__N, key, url, as, __vinext_queryOwner) to be merged in. But the implementation still early-returns whenever any existing state is present:

const existingState = window.history.state;
if (existingState !== null && existingState !== undefined) {
  routerRuntimeState.currentHistoryKey =
    getRouterStateKey(existingState) ?? routerRuntimeState.currentHistoryKey;
  return; // <-- never merges __N / __vinext_queryOwner / url / as
}

So when third-party state is present, the entry keeps no __N, which means isNextRouterState() returns false for it and getCurrentQueryOwner() falls back to "browser" — defeating the server query-ownership the PR is trying to preserve on the very first entry.

Either:

  • update stampInitialHistoryState to merge the router-shaped fields into a non-router existing state (preserving foreign keys) so it matches the docstring and the test, or
  • if the early-return is the intended behavior, drop/adjust the test and revert the docstring.

Given the PR's stated goal (preserving server query ownership across hydration and history traversal), the merge behavior described by the docstring looks like the correct fix.

Non-blocking notes

  1. Header serialization is inconsistent between dev and prod. pages-page-handler.ts:684 uses safeJsonStringify(query) (HTML-escapes <, >, &) for the x-vinext-resolved-query header, while dev-server.ts:1465 uses plain JSON.stringify(query). The client parses both with JSON.parse, so this is functionally equivalent, but safeJsonStringify is intended for inline-script HTML contexts, not header values. Consider using plain JSON.stringify in both for clarity/parity.

  2. initialResolvedQuery is serialized into __NEXT_DATA__ for every Pages page (pages-page-handler.ts:519, dev-server.ts:1592), even pages with no rewrites/middleware where it just duplicates query. Consider gating it on hasRewrites || hasMiddleware to avoid the per-page payload cost on the common path.

  3. Config rewrites over-record rewrite query keys. For middleware rewrites, recordRewriteQueryKeys(rewriteUrl, originalResolvedUrl) correctly excludes unchanged keys, but config rewrites call recordRewriteQueryKeys(rewritten) with no inherited URL, so a destination key whose value happens to equal a user-supplied search param (e.g. user ?a=1, rewrite to /bar?a=1) gets hidden pre-hydration. The final value is identical, so there is no user-visible value difference, but it may cause an extra pre-ready render with the key absent. Minor parity nit.

  4. Redundant extractRouteParamsFromPath call in navigationRequiresServerQueryOwnership (router.ts:1247 and again at :1253) on the navigation hot path — compute once and reuse.

@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

To https://github.com/cloudflare/vinext.git
! [rejected] codex/fix-pages-prerender-parity -> codex/fix-pages-prerender-parity (fetch first)
error: failed to push some refs to 'https://github.com/cloudflare/vinext.git'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: prerender rewrite query parity (#2218) — re-review @ fffb8fc

The previous blocking issue (stampInitialHistoryState early-returning instead of merging foreign state) has been fixed — it now does { ...existingState, ...initialState } (packages/vinext/src/shims/router.ts:822), and the "stamps initial router state without dropping third-party history fields" test passes. The newest commit (fffb8fc) also correctly defers the next/router import via await import("next/router") so the module's top-level installPagesRouterRuntime()stampInitialHistoryState() runs after window.__NEXT_DATA__ (and thus __NEXT_DATA__.locale) is populated. Good fix.

However, that same commit introduces a new blocking failure.

Blocking: a test in this PR fails (tests/entry-templates.test.ts)

tests/entry-templates.test.ts"gracefully skips Pages Router initialization without NEXT_DATA" now fails:

TypeError: A dynamic import callback was not specified.
Serialized Error: { code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING' }
 Tests  1 failed | 6 passed | 26 skipped (33)

This will fail the required Vitest check.

Cause: Commit fffb8fc changed the generated Pages client entry from a static
import Router, { ... } from "next/router" to
const { default: Router, ... } = await import("next/router")
(packages/vinext/src/entries/pages-client-entry.ts:159 and packages/vinext/src/server/dev-server.ts:1613).

The sibling test at tests/entry-templates.test.ts:1161 slices the generated initializationCode and executes it with vm.runInNewContext(...) (line 1184). That context provides _initializePagesRouterReadyFromNextData as a global but no importModuleDynamically callback, so the newly-added await import("next/router") throws ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING before the code can reach its intended "[vinext] No __NEXT_DATA__ found" path.

The PR updated the string-assertion template test (line 1135–1147) to match the new dynamic import, but missed this executed test, which still assumes the router symbols arrive via context globals rather than a dynamic import.

Fix options:

  • Provide an importModuleDynamically option to vm.runInNewContext (line 1184) that resolves "next/router" to a stub exposing { default, wrapWithRouterContext, _initializePagesRouterReadyFromNextData }, or
  • Restructure the test so the early if (!nextData) return short-circuit is exercised without evaluating the await import("next/router") line (e.g. assert on the console.error path differently), or
  • Keep the router symbols as injected context globals for this slice.

Either way the executed test must be updated to match the dynamic-import entry shape, the same way the string-assertion test was.

Non-blocking notes (carried over, still applicable)

  1. Header serialization still inconsistent between dev and prod. pages-page-handler.ts:684 uses safeJsonStringify(query) for the x-vinext-resolved-query header while dev-server.ts:1465 uses plain JSON.stringify(query). Functionally equivalent (both parsed via JSON.parse), but safeJsonStringify is meant for inline-script HTML contexts, not header values. Prefer plain JSON.stringify in both for parity.

  2. initialResolvedQuery is serialized into __NEXT_DATA__ for every Pages page, even pages with no rewrites/middleware where it duplicates query. Consider gating it on hasRewrites || hasMiddleware.

  3. Config rewrites over-record rewrite query keys vs middleware rewrites (no inherited URL passed to recordRewriteQueryKeys), so a destination key whose value equals a user search param gets hidden pre-hydration. Final value is identical; may cause one extra pre-ready render. Minor parity nit.

Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>
@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review posted to PR #2218.

Summary

I re-reviewed PR #2218 at the current HEAD (fffb8fc), which is newer than the commit the prior automated review saw (356fa6a).

Good news: The prior blocking issue is resolved. stampInitialHistoryState now merges foreign history state ({ ...existingState, ...initialState }) instead of early-returning, and that test passes. The latest commit's switch to await import("next/router") is a sound fix — it ensures the router module's top-level installPagesRouterRuntime() runs after window.__NEXT_DATA__ is populated.

New blocking issue found: That same commit introduces a failing test. tests/entry-templates.test.ts → "gracefully skips Pages Router initialization without NEXT_DATA" fails with ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING. The PR updated the string-assertion template test to match the new dynamic import but missed the sibling test that actually executes the sliced entry code via vm.runInNewContext without a dynamic-import callback. This will fail the required Vitest CI check.

I verified the failure directly (and confirmed the previously-failing shims tests now pass), and provided concrete fix options in the review.

The three non-blocking notes (header serialization parity, unconditional initialResolvedQuery serialization, config-rewrite over-recording) are carried over and still applicable.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

error: Your local changes to the following files would be overwritten by checkout:
pnpm-lock.yaml
Please commit your changes or stash them before you switch branches.
Aborting

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

error: Your local changes to the following files would be overwritten by checkout:
pnpm-lock.yaml
Please commit your changes or stash them before you switch branches.
Aborting

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

error: Your local changes to the following files would be overwritten by checkout:
pnpm-lock.yaml
Please commit your changes or stash them before you switch branches.
Aborting

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: prerender rewrite query parity (#2218) — re-review @ 251281a

Re-reviewed at the current HEAD (251281a), which is several commits past the previously-reviewed fffb8fc. Both prior blocking issues are resolved.

Prior blockers — fixed

  1. stampInitialHistoryState foreign-state mergesyncInitialHistoryStateFromNextData now merges { ...existingState, ...initialState } (shims/router.ts:828) while preserving an existing history key. The renamed test (pages-router-i18n-sticky-locale.test.ts → "install preserves pre-existing history fields while stamping router state") asserts foreign: true survives alongside __N / options.locale, and passes.

  2. ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING in entry-templates.test.ts — fixed by reverting the client entry from await import("next/router") back to a static import Router, { ... } from "next/router" (entries/pages-client-entry.ts:79), then introducing _syncInitialPagesRouterStateFromNextData() which is called explicitly after __NEXT_DATA__ is populated (pages-client-entry.ts:141). This decouples the locale-dependent stamp from module-eval timing without needing a dynamic import. The full tests/entry-templates.test.ts suite (33 tests) now passes.

I verified the affected suites locally at 251281a:

  • tests/entry-templates.test.ts — 33 passed
  • tests/shims.test.ts — 1147 passed
  • tests/query.test.ts — 25 passed
  • tests/pages-router.test.ts — 318 passed
  • tests/pages-router-i18n-sticky-locale.test.ts, tests/pages-request-pipeline.test.ts — passing
  • vp check on the five changed source files — clean (format, lint, types)

Verified correctness highlights

  • Prototype-pollution-safe query handling. setOwnQueryValue uses Object.defineProperty (utils/query.ts:14), so a malicious __proto__/constructor key in the x-vinext-resolved-query header or initialResolvedQuery cannot pollute the prototype. The header parse path (shims/router.ts:1942-1951) also type-checks each value (string or string[]) before assigning.
  • Header-spoof guard present in both server paths. User-supplied x-vinext-resolved-query is stripped before the trusted value is re-set in both prod (pages-page-handler.ts:679-684) and dev (dev-server.ts:1460-1465).
  • Dev/prod parity. buildInitialPagesRouterQuery produces the pre-ready initialQuery identically in prod (pages-page-handler.ts:427) and dev (dev-server.ts:585). rewriteQueryKeys flows to the prod page handler via the renderPage callback (pages-request-pipeline.ts:664/691/699) and to dev via index.ts:4290 — both wired.

Non-blocking notes (carried over, still applicable)

  1. Header serialization inconsistent between dev and prod. pages-page-handler.ts:684 uses safeJsonStringify(query) for the x-vinext-resolved-query header while dev-server.ts:1465 uses plain JSON.stringify(query). Functionally equivalent (client parses both with JSON.parse), but safeJsonStringify is intended for inline-script HTML contexts, not header values. Prefer plain JSON.stringify in both for parity/clarity.

  2. initialResolvedQuery serialized into __NEXT_DATA__.__vinext for every Pages page (pages-page-handler.ts:519, dev-server.ts:1594), even pages with no rewrites/middleware where it duplicates query. Consider gating on hasRewrites || hasMiddleware to trim the common-path payload.

  3. Config rewrites over-record rewrite query keys. Middleware rewrites pass the inherited URL to exclude unchanged keys (recordRewriteQueryKeys(result.rewriteUrl, originalResolvedUrl), pages-request-pipeline.ts:413), but config rewrites call recordRewriteQueryKeys(rewritten) with no inherited URL (:488, :568, :617, :684, :737). A destination key whose value equals a user search param gets hidden pre-hydration. Final value is identical, so no user-visible value difference, but it may cause one extra pre-ready render with the key absent. Minor parity nit.

  4. Redundant extractRouteParamsFromPath call in navigationRequiresServerQueryOwnership — computed at router.ts:1251 and recomputed at :1257 on the navigation hot path. Compute once and reuse.

Verdict

No blocking issues. The change is well-tested and consistent across dev/prod/worker. The four notes above are optional polish.

Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>
@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review posted to PR #2218.

Summary

I re-reviewed PR #2218 at the current HEAD (251281a), which is several commits past the previously-reviewed fffb8fc. Both previously-blocking issues are now resolved.

Prior blockers — fixed:

  1. stampInitialHistoryState now merges foreign history state ({ ...existingState, ...initialState }) instead of early-returning, preserving third-party fields. Renamed test passes.
  2. The ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING failure in entry-templates.test.ts is fixed by reverting the client entry to a static import of next/router and adding an explicit _syncInitialPagesRouterStateFromNextData() call that runs after __NEXT_DATA__ is populated. All 33 tests pass.

Verified locally at 251281a: entry-templates (33), shims (1147), query (25), pages-router (318), i18n-sticky-locale, pages-request-pipeline — all passing; vp check clean on changed source files.

Verified correctness: prototype-pollution-safe query handling (Object.defineProperty), header-spoof guard present in both dev/prod, and dev/prod/worker parity for initialQuery and rewriteQueryKeys wiring.

No blocking issues found. Carried over four non-blocking notes (header serialization inconsistency, unconditional initialResolvedQuery serialization, config-rewrite over-recording, redundant extractRouteParamsFromPath call) — all optional polish.

github run

@james-elicx
james-elicx marked this pull request as ready for review June 21, 2026 17:59
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: prerender rewrite query parity (#2218) — re-review @ 180cd48

Re-reviewed at the current HEAD (180cd48), two commits past the previously-reviewed 251281a. Both new commits (251281a, 180cd48) are lockfile-only cleanups ("remove unrelated lockfile importer") — no source changes. Both prior blocking issues remain resolved, and no new issues were introduced.

Prior blockers — still fixed

  1. stampInitialHistoryState foreign-state mergesyncInitialHistoryStateFromNextData merges { ...existingState, ...initialState } and preserves an existing history key (shims/router.ts:820-832). Foreign fields survive alongside __N / query ownership.
  2. ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING in entry-templates.test.ts — the client entry uses a static import of next/router plus an explicit post-__NEXT_DATA__ sync, so the executed-slice test no longer hits a dynamic import in vm.runInNewContext.

Verified locally at 180cd48

  • tests/entry-templates.test.ts — 33 passed
  • tests/shims.test.ts — 1147 passed
  • tests/query.test.ts — 25 passed
  • tests/pages-router.test.ts, tests/pages-request-pipeline.test.ts, tests/pages-router-i18n-sticky-locale.test.ts — 386 passed combined
  • vp check on the five changed source files — clean (format, lint, types)

Verified correctness highlights

  • Prototype-pollution-safe query handling. setOwnQueryValue uses Object.defineProperty (utils/query.ts:14-20), so a malicious __proto__/constructor key cannot pollute the prototype. The header parse path (shims/router.ts:1942-1951) type-checks each value (string or string[]) before assigning.
  • Header-spoof guard present in both server paths. User-supplied x-vinext-resolved-query is stripped before the trusted value is re-set in both prod (pages-page-handler.ts:679-684) and dev (dev-server.ts:1460-1465).
  • Dev/prod parity. buildInitialPagesRouterQuery produces the pre-ready initialQuery identically in prod (pages-page-handler.ts:427) and dev (dev-server.ts:585). rewriteQueryKeys flows through the shared pages-request-pipeline.ts (:636-641, :753-756) to the prod handler and via index.ts:4290, keeping prod/worker/dev consistent.

Non-blocking notes (carried over, still applicable)

  1. Header serialization inconsistent between dev and prod. pages-page-handler.ts:684 uses safeJsonStringify(query) for the x-vinext-resolved-query header while dev-server.ts:1465 uses plain JSON.stringify(query). Functionally equivalent (client parses both with JSON.parse), but safeJsonStringify is intended for inline-script HTML contexts, not header values. Prefer plain JSON.stringify in both for parity/clarity.

  2. initialResolvedQuery serialized into __NEXT_DATA__.__vinext for every Pages page (pages-page-handler.ts:519, dev-server.ts:1594), even pages with no rewrites/middleware where it duplicates query. Consider gating on hasRewrites || hasMiddleware to trim the common-path payload.

  3. Config rewrites over-record rewrite query keys. Middleware rewrites pass the inherited URL to exclude unchanged keys (recordRewriteQueryKeys(result.rewriteUrl, originalResolvedUrl), pages-request-pipeline.ts:413), but config rewrites call recordRewriteQueryKeys(rewritten) with no inherited URL (:488, :568, :617, :684, :737). A destination key whose value equals a user search param gets hidden pre-hydration. Final value is identical (no user-visible value difference), but it may cause one extra pre-ready render with the key absent. Minor parity nit.

  4. Redundant extractRouteParamsFromPath call in navigationRequiresServerQueryOwnership — computed at shims/router.ts:1251 and recomputed at :1257 on the navigation hot path. Compute once and reuse.

Verdict

No blocking issues. The change is well-tested and consistent across dev/prod/worker. The four notes above are optional polish.

@ask-bonk

ask-bonk Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review posted to PR #2218.

Summary

Re-reviewed at HEAD 180cd48, two commits past the previously-reviewed 251281a. No blocking issues found.

Key findings:

  • The two new commits since the last review are lockfile-only cleanups — no source changes. Both previously-blocking issues (stampInitialHistoryState foreign-state merge and the vm dynamic-import failure in entry-templates.test.ts) remain resolved.
  • Verified locally at 180cd48: entry-templates (33), shims (1147), query (25), and pages-router suites (386 combined) all pass; vp check clean on the five changed source files.
  • Confirmed correctness of prototype-pollution-safe query handling (Object.defineProperty in query.ts:14), header-spoof guards in both dev and prod paths, and dev/prod/worker parity for initialQuery/rewriteQueryKeys wiring through the shared pipeline.
  • Carried over four non-blocking polish notes (header serialization inconsistency, unconditional initialResolvedQuery serialization, config-rewrite over-recording, redundant extractRouteParamsFromPath call) — all independently re-verified as still accurate.

Verdict: Well-tested, consistent across dev/prod/worker. Ready to merge; the four notes are optional polish.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

Worker D note for deploy-suite run 28478866791 / job 84413308650: I think this PR covers the non-dynamic SSR query leak failure (). Skipping that item and continuing with the remaining uncovered Pages prerender/GSSP/revalidation failures.

@james-elicx

Copy link
Copy Markdown
Member Author

Correction to my previous Worker D note: for deploy-suite run 28478866791 / job 84413308650, I think this PR covers the test/e2e/prerender.test.ts non-dynamic SSR query leak failure (should not supply query values to params or useRouter non-dynamic page SSR). Skipping that item and continuing with the remaining uncovered Pages prerender/GSSP/revalidation failures.

@james-elicx

Copy link
Copy Markdown
Member Author

Pages functional remaining pass for deploy-suite run 28478866791 / job 84413308650: the TSV still includes test/e2e/prerender.test.ts -> should not supply query values to params or useRouter non-dynamic page SSR, and this PR appears to cover that exact prerender rewrite-query/readiness family. Skipping a duplicate implementation for this item.

@james-elicx

Copy link
Copy Markdown
Member Author

Run 28938793088 (Next.js v16.3.0-canary.80) still fails related Pages Router prerender/rewrite readiness behavior, notably test/e2e/middleware-rewrites/test/index.test.ts (should handle static rewrite from next.config.js correctly). This PR appears to own the prerender rewrite query/readiness portion, so I am skipping a duplicate fix for that overlap in the current backlog pass.

@james-elicx

Copy link
Copy Markdown
Member Author

Backlog closure for Actions run 29871622126 / job 88775791401: this PR no longer retains a unique functional failure from that run. The static next.config.js rewrite-query row in test/e2e/middleware-rewrites/test/index.test.ts is covered by refreshed #2454, while the related middleware rewrite/data/cache state is covered by #2216 and #2454.

The refreshed #2454 head f3408a8aec0e97196335860c9d1935d244b7bbe9 passes the exact Next.js v16.2.6 matrix: middleware-general 66/66, node-runtime 68/68, middleware-trailing-slash 23/23, and middleware-rewrites 56 passed with 2 intentional skips. Its independent review is clean.

I am treating #2218 as superseded for this failure backlog only; its broader prerender-readiness and query-history parity cases were not separate failures in run 29871622126.

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