Pages Router prerender: pages under `/api-...` and lazy catchall pages never finish loading
#1,542 创建于 2026年5月22日
仓库指标
- 星标
- (8,625 个星标)
- PR 合并指标
- (平均合并 1天 1小时) (30 天内合并 462 个 PR)
描述
This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.2.6, 2026-05-22).
Problem
Pages whose path begins with /api-docs/... (an apparent false positive of API-route detection) and lazy fallback catch-all pages (fallback: true) hang waiting for the rendered content. The fallback boundary stays on fallback text and never resolves to the page contents.
page.waitForSelector('#api-docs') timeout
TIMED OUT: /Hi.*?delayby3s/
Estimated Impact
~3 test failures across the deploy suite.
Affected Test Suites
test/e2e/prerender.test.ts(3 failures)
Recommendation
-
Reproduce first in vinext's own test suite. Add a Pages Router page at
pages/api-docs/index.tsxand a[...slug]lazy catchall. Verify each finishes loading. -
Tighten API-route detection. Match only
pages/api/...(with the slash), not the substringapi-. Otherwise pages whose path starts withapi-are treated as API routes and never render. -
Resolve the fallback for lazy catchall. Make sure the prerender fallback resolves to the rendered content once
getStaticPropscompletes.
Part of #1328.