Files
Wyatt JohnsonandGitHub c6cd1f455f Relax default.tsx validation for parallel routes leaf segments (#84767)
### What?

Relaxes the overly strict `default.tsx` validation for parallel routes
to only require the file when it's actually needed (non-leaf segments
with routable children).

### Why?

The initial validation for parallel routes required `default.tsx` files
for all parallel route slots to prevent a specific issue: when
navigating to child routes, missing `default.tsx` files could cause
silent 404s in slot content, creating a confusing user experience.

However, this validation was **too strict** - it required `default.tsx`
even in cases where it wasn't actually necessary:

1. **Leaf segments** (routes with no child routes) - There are no child
routes to navigate to, so the 404 issue cannot occur
2. **Route groups** - These are organizational folders and aren't
routable themselves
3. **Catch-all parameters** - The matched segments are dynamic parameter
values, not actual child route segments

This caused false positive build errors for valid parallel route
configurations that don't have the underlying navigational issue.

NAR-448
2025-10-16 13:45:38 -06:00

28 lines
702 B
TypeScript

import Link from 'next/link'
export default function HomePage() {
return (
<div>
<h1>Build Error Scenarios Test</h1>
<p>
These routes SHOULD cause MissingDefaultParallelRouteError because they
have parallel routes without default.tsx files AND have child routes.
</p>
<nav>
<ul>
<li>
<Link href="/with-children">
Non-Leaf Segment with Children (SHOULD ERROR)
</Link>
</li>
<li>
<Link href="/with-groups-and-children">
Non-Leaf with Route Groups and Children (SHOULD ERROR)
</Link>
</li>
</ul>
</nav>
</div>
)
}