Summary
Routes that have a layout.tsx (with parallel slots) but no page.tsx are currently skipped by the prerender phase, so they are never statically exported. This affects ALL layout-only routes — it is not a new regression.
Details
In build/prerender.ts, line 849, any route with !route.pagePath is skipped:
if (!route.pagePath) continue;
This means routes like:
/parallel-nested/home (has layout.tsx + @parallelB/default.tsx, no page.tsx)
/slot-collision (has layout.tsx + @modal/default.tsx, no page.tsx)
...work correctly in dev/SSR but are silently omitted from static export (output: 'export').
Why this matters
Next.js supports layout.tsx + @slot/page.tsx patterns where the parent segment has no explicit page.tsx (the slot provides the content). These routes should still be prerenderable if the slot sub-pages are static.
Root cause
The classifyAppRoute function and the prerender loop both key off route.pagePath (the children slot). They do not consider whether parallel slot pages exist that could serve as the renderable content for static generation.
Potential fix
Teach classifyAppRoute and the prerender loop to recognize layout-only routes that have at least one parallel slot with a pagePath as renderable. The synthetic sub-routes created by discoverSlotSubRoutes already have slot pagePath populated — prerender just needs to look at the slots when route.pagePath is null.
References
Summary
Routes that have a
layout.tsx(with parallel slots) but nopage.tsxare currently skipped by the prerender phase, so they are never statically exported. This affects ALL layout-only routes — it is not a new regression.Details
In
build/prerender.ts, line 849, any route with!route.pagePathis skipped:This means routes like:
/parallel-nested/home(haslayout.tsx+@parallelB/default.tsx, nopage.tsx)/slot-collision(haslayout.tsx+@modal/default.tsx, nopage.tsx)...work correctly in dev/SSR but are silently omitted from static export (
output: 'export').Why this matters
Next.js supports
layout.tsx+@slot/page.tsxpatterns where the parent segment has no explicitpage.tsx(the slot provides the content). These routes should still be prerenderable if the slot sub-pages are static.Root cause
The
classifyAppRoutefunction and the prerender loop both key offroute.pagePath(the children slot). They do not consider whether parallel slot pages exist that could serve as the renderable content for static generation.Potential fix
Teach
classifyAppRouteand the prerender loop to recognize layout-only routes that have at least one parallel slot with apagePathas renderable. The synthetic sub-routes created bydiscoverSlotSubRoutesalready have slotpagePathpopulated — prerender just needs to look at the slots whenroute.pagePathis null.References
packages/vinext/src/routing/app-route-graph.ts:369-375build/prerender.ts:849