This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-22).
Problem
Pages Router does not return 405 Method Not Allowed for POST requests to static (GSP/SSP) pages, and res.revalidate() paired with preview cookies (used by on-demand revalidate / API endpoints) does not produce a usable response. The method-dispatch and preview-cookie plumbing are missing from the Pages Router server.
Expected: 405 | Received: 200 (POST to static page)
res.revalidate() with preview cookies fails to refresh
Estimated Impact
~2 test failures across the deploy suite.
Affected Test Suites
test/e2e/prerender.test.ts (2 failures)
Recommendation
-
Reproduce first in vinext's own test suite. POST to a Pages Router static page and assert 405; trigger res.revalidate() from an API route after setting a preview cookie and assert the page content updates.
-
Implement method-allow checks for static pages. Static (GSP) pages should reject non-GET/HEAD methods with 405 and emit an Allow header.
-
Honor preview cookies in revalidate. Make sure res.revalidate() reads the preview-mode cookie when present and uses the preview render path, not the production cache.
Problem
Pages Router does not return 405 Method Not Allowed for POST requests to static (GSP/SSP) pages, and
res.revalidate()paired with preview cookies (used by on-demand revalidate / API endpoints) does not produce a usable response. The method-dispatch and preview-cookie plumbing are missing from the Pages Router server.Estimated Impact
~2 test failures across the deploy suite.
Affected Test Suites
test/e2e/prerender.test.ts(2 failures)Recommendation
Reproduce first in vinext's own test suite. POST to a Pages Router static page and assert 405; trigger
res.revalidate()from an API route after setting a preview cookie and assert the page content updates.Implement method-allow checks for static pages. Static (GSP) pages should reject non-GET/HEAD methods with 405 and emit an
Allowheader.Honor preview cookies in revalidate. Make sure
res.revalidate()reads the preview-mode cookie when present and uses the preview render path, not the production cache.