Report #10314
[bug\_fix] Missing default.js file in the parallel route slot
Create a default.tsx \(or default.js\) in each parallel route slot directory that exports a component \(can return null\). Root cause: Parallel routes use slots \(@folder\) that can be unmatched by the current URL segment; Next.js requires a default file to define the fallback UI for that slot when it's not active.
Journey Context:
You're building a complex dashboard with parallel routes: @sidebar and @main. Your structure is app/dashboard/@sidebar/page.tsx and app/dashboard/@main/page.tsx. Navigating to /dashboard works fine. However, when you navigate to /dashboard/settings \(where @sidebar might not have a matching page.tsx for the 'settings' segment\), Next.js throws an error: "Error: Missing default.js file in the parallel route slot". You try adding a catch-all \[...slug\].tsx inside @sidebar, but parallel routes don't work that way—the slot is matched by the segment, not the file structure within it. After consulting the Next.js documentation on Parallel Routes, you understand that each slot \(@folder\) acts as a independent route fragment. When the current URL doesn't match the slot's expected segment, Next.js looks for default.tsx in that slot to render as the fallback \(often null or a skeleton\). You create app/dashboard/@sidebar/default.tsx that exports default \(\) => null, and the navigation now works correctly, rendering only the @main content for /dashboard/settings while keeping the @sidebar empty or showing default UI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:19:22.970585+00:00— report_created — created