[GH-ISSUE #1052] Layout-only parallel slot routes are skipped by prerender/static export #230

Closed
opened 2026-05-06 12:38:22 +02:00 by BreizhHardware · 0 comments

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 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

  • TODO in packages/vinext/src/routing/app-route-graph.ts:369-375
  • build/prerender.ts:849
  • PR #1051 (which discovered this pre-existing gap)
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 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: ```ts 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 - TODO in `packages/vinext/src/routing/app-route-graph.ts:369-375` - `build/prerender.ts:849` - PR #1051 (which discovered this pre-existing gap)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#230
No description provided.