mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
dea15ec603
Interception routes only describe the branch used during a soft
navigation, but every URL they can produce still needs to be handled by
an ordinary App Router page matcher for a direct request or refresh.
Today an interception-only URL can appear to work during client
navigation and then 404 when the same URL is loaded directly. This makes
strict route matching reject that configuration.
For example, this setup is incomplete:
```
app/
@modal/
(.)photo/
[...id]/
page.tsx
photo/
[id]/
page.tsx
```
The ordinary route handles `/photo/1`, but the interception route also
handles `/photo/1/2`, which has no ordinary page matcher. Widening the
ordinary route makes the setup valid:
```
app/
@modal/
(.)photo/
[...id]/
page.tsx
photo/
[...id]/
page.tsx
```
The validation checks coverage rather than requiring an identical
matcher. A broader catchall can cover the intercepted pattern, and
multiple ordinary matchers can cover different accepted lengths. For
example, `items/page.tsx` together with `items/[...rest]/page.tsx`
covers an intercepted `items/[[...parts]]` matcher. Route handlers and
generated metadata routes do not count as canonical page matchers.
Webpack and Turbopack now apply the same coverage check and report the
interception matcher and the canonical pattern that is not fully
covered. Existing interception fixtures now include semantically
complete ordinary routes instead of relying on interception-only URLs.
<!-- NEXT_JS_LLM -->