mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #1052] Layout-only parallel slot routes are skipped by prerender/static export #230
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @NathanDrake2406 on GitHub (May 4, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/1052
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