mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Introduces a null-rendering default component for interception routes to prevent 404 responses when children slots are missing. ### Why? When rendering interception routes like `(.)[id]`, there's a segment mismatch where the interception route lacks a children slot that the base `[id]` route has. **The Bug:** Previously, the framework injected a 404 page into the missing default slot for the children route. On platforms like Vercel, this caused full 404 RSC responses because the HTTP status code has semantic meaning for route behavior when using cache components. This resulted in the "unknown segment value fallback page" issue. **Impact:** - RSC requests for interception routes would return 404 status codes - Platform routing behavior was incorrectly triggered by these 404 responses - Only affects pages rendering with cache components ### How? - Created new `default-null.tsx` builtin component that renders `null` - Updated Rust code (`app_structure.rs`) to detect interception routes and use the null default - Updated webpack loader (`next-app-loader/index.ts`) to check `isInterceptionRouteAppPath()` and inject the null default - Removed test-specific default component that was working around this bug - The old `page.tsx` is still used during client navigation, so there's no visible change to users This ensures minimal RSC payload changes and prevents 404 status codes while maintaining existing client-side behavior. NAR-483
18 lines
596 B
TypeScript
18 lines
596 B
TypeScript
/**
|
|
* TEST CASE 2: Interception route WITHOUT parallel routes
|
|
*
|
|
* Expected: NO default.tsx needed at (.)no-parallel-routes level
|
|
* Reason: No @parallel routes exist, so no implicit layout created
|
|
* Only has a nested page, no children slot at root level
|
|
*/
|
|
export default function Page() {
|
|
return (
|
|
<div>
|
|
<h3>✅ TEST CASE 2: No parallel routes</h3>
|
|
<p>This is a nested page under (.)no-parallel-routes/deeper</p>
|
|
<p>No @sidebar or other parallel routes exist at parent level.</p>
|
|
<p>NO default.tsx needed at (.)no-parallel-routes!</p>
|
|
</div>
|
|
)
|
|
}
|