Skip to content

Prune incomplete parallel route matchers - #97108

Open
gnoff wants to merge 3 commits into
jstory/omit-implicit-children-slotsfrom
jstory/prune-incomplete-matchers
Open

Prune incomplete parallel route matchers#97108
gnoff wants to merge 3 commits into
jstory/omit-implicit-children-slotsfrom
jstory/prune-incomplete-matchers

Conversation

@gnoff

@gnoff gnoff commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This extends experimental.strictRouteMatching so a matcher is left out when its loader tree contains a synthesized default that will always call notFound(). More specific matchers that combine the catchall with pages in other slots are still included, and adding a default.tsx keeps the broader matcher.

The main goal is to make children and named slots behave the same way. If a URL cannot construct a complete route tree on its own, it should be treated as an unmatched URL instead of sometimes showing a slot 404 and sometimes producing a missing page or default error.

We got here incrementally. #47872 introduced the 404 fallback for unmatched parallel slots, #60186 added a development warning because this was confusing in practice and linked #51805 and #49569, and #84702 later made a missing default a build error for named slots while leaving children on the old fallback for backwards compatibility. Strict matching takes the next step and treats a matcher that can only construct a permanent 404 tree as unmatched.

This changes soft navigations that only worked by preserving a previously active slot even though the URL could not be loaded directly, which is why it is part of the experimental strict matching behavior. Interception routes that use the null fallback added in #85779 are left alone. This change however is well motivated because if you did client nav to a route that only matches a named slot and then hard refresh you will end up getting a 404. This is a sign our current semantics are actually broken.

If you want to preserve the perma 404 behavior of the slot-without-default you can just add a default and make it call notFound() unconditionally.

The base PR defaults strictRouteMatching to true so canary applications and the full CI suite exercise the corrected semantics without requiring opt in. An explicit false keeps the legacy behavior as a temporary escape hatch while this bakes. This is intended to be an opt-out rollout rather than a permanent split in router semantics.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Stats from current PR

🔴 3 regressions, 2 improvements

Metric Canary PR Change Trend
node_modules Size 553 MB 553 MB 🔴 +119 kB (+0%) ▁▁▁▁▁
Turbo Build Time 5.831s 6.159s 🔴 +328ms (+6%) ▁▃▁▃▄
Turbo Build Time (cached) 2.921s 3.220s 🔴 +299ms (+10%) ▂▂▁▆▆
Webpack Build Time 24.861s 24.269s 🟢 592ms (-2%) █▂▁▁▁
Webpack Build Time (cached) 24.819s 24.308s 🟢 511ms (-2%) █▂▁▁▁
📊 All Metrics
📖 Metrics Glossary

Dev Server Metrics:

  • Listen = TCP port starts accepting connections
  • First Request = HTTP server returns successful response
  • Cold = Fresh build (no cache)
  • Warm = With cached build artifacts

Build Metrics:

  • Fresh = Clean build (no .next directory)
  • Cached = With existing .next directory

Change Thresholds:

  • Time: Changes < 50ms AND < 10%, OR < 2% are insignificant
  • Size: Changes < 1KB AND < 1% are insignificant
  • All other changes are flagged to catch regressions

⚡ Dev Server

Metric Canary PR Change Trend
Cold (Listen) 813ms 812ms ▅▅▁▄▅
Cold (Ready in log) 790ms 800ms ▃▄▁▄▅
Cold (First Request) 1.293s 1.359s ▂▄▁▄▅
Warm (Listen) 813ms 813ms ▄▅▁▅▅
Warm (Ready in log) 802ms 805ms ▂▅▁█▄
Warm (First Request) 1.329s 1.338s ▁▅▂█▄
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 813ms 813ms █▁▁▁▁
Cold (Ready in log) 786ms 786ms █▂▁▁▁
Cold (First Request) 3.337s 3.344s █▂▂▁▁
Warm (Listen) 813ms 813ms █▂▂▂▂
Warm (Ready in log) 784ms 790ms █▂▂▁▁
Warm (First Request) 3.373s 3.470s █▂▂▁▁

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 5.831s 6.159s 🔴 +328ms (+6%) ▁▃▁▃▄
Cached Build 2.921s 3.220s 🔴 +299ms (+10%) ▂▂▁▆▆
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 24.861s 24.269s 🟢 592ms (-2%) █▂▁▁▁
Cached Build 24.819s 24.308s 🟢 511ms (-2%) █▂▁▁▁
node_modules Size 553 MB 553 MB 🔴 +119 kB (+0%) ▁▁▁▁▁
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
00hz9bp6px29t.js gzip 162 B N/A -
02n-1c_6-_z6p.js gzip 161 B N/A -
050icza-xjz0i.js gzip 5.73 kB N/A -
07jdby0ue616s.js gzip 450 B N/A -
0bjdc8muo74n5.js gzip 8.71 kB N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0jrl8kox2uf45.js gzip 157 B N/A -
0nhmtnlj8hr6m.js gzip 158 B N/A -
0q36apx7b1q_e.js gzip 7.54 kB N/A -
0rci1f3or1a19.js gzip 13.3 kB N/A -
0sasp2uaf4ye5.js gzip 169 B N/A -
1_2x714--ii1i.js gzip 8.76 kB N/A -
1-3y752pkth5-.js gzip 10 kB N/A -
1c7o26spjhd9d.js gzip 157 B N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1k6dd7su4cfei.js gzip 3.57 kB N/A -
1tf1phijqlx9j.js gzip 220 B 220 B
1uzabyd1120a1.js gzip 8.71 kB N/A -
1xf4ba83xb-84.js gzip 158 B N/A -
2-ufv8lc-g7gg.js gzip 10.6 kB N/A -
21kmjy_10x14f.js gzip 8.81 kB N/A -
28dhc6t85q1_p.js gzip 8.78 kB N/A -
2f-ilvczue-tp.js gzip 9.46 kB N/A -
2f1u17u5c8iny.js gzip 8.79 kB N/A -
2gq4lz6qq2chp.js gzip 71.6 kB N/A -
2ikltg_8iegxw.js gzip 10.3 kB N/A -
2rlwpl-wmbug5.js gzip 159 B N/A -
2t_dpo8ddqq4x.js gzip 159 B N/A -
2vxi673cz1-t4.js gzip 8.79 kB N/A -
38-q43pzktqhs.js gzip 1.46 kB N/A -
3g_iitcj-4_gx.js gzip 157 B N/A -
3hztwd4v6tf3a.js gzip 65.6 kB N/A -
3kovaxbq70rv3.js gzip 156 B N/A -
3mrwxzed0ylgv.js gzip 13.1 kB N/A -
3nbojhxiy1qv_.js gzip 13.7 kB N/A -
3sc2kd974a_o4.js gzip 152 B N/A -
3tldxa0ocqpwa.js gzip 47 kB N/A -
41u5s3oe2-erp.js gzip 2.29 kB N/A -
42t9sinrl8nmb.js gzip 157 B N/A -
445s_9hf8o7ao.js gzip 8.76 kB N/A -
turbopack-1l..-5yv.js gzip 3.73 kB 3.73 kB
0-6bcj16ji2wf.js gzip N/A 10.6 kB -
07ryk0jced-sc.js gzip N/A 8.78 kB -
0jwho9fkrb_t3.js gzip N/A 2.29 kB -
0nzvszqtjjcdv.js gzip N/A 155 B -
0roh390ijzxa5.js gzip N/A 8.75 kB -
0vex9w55ursqj.js gzip N/A 8.79 kB -
1_l19exhzl_h4.js gzip N/A 157 B -
17oe55cu76cd7.js gzip N/A 450 B -
1drww5xikb-c-.js gzip N/A 9.46 kB -
1dwjcsink-x9d.js gzip N/A 154 B -
1g60xde_dv17t.js gzip N/A 8.79 kB -
1shyvhno4_0tn.js gzip N/A 156 B -
1uzv47btzam64.js gzip N/A 5.73 kB -
1vy7n7wxv_rh5.js gzip N/A 8.81 kB -
2-0i7pl900-ou.js gzip N/A 8.71 kB -
2-kcbngm7ik7y.js gzip N/A 8.75 kB -
2-szwf6t9xq20.js gzip N/A 156 B -
29n7_9qs6pr33.js gzip N/A 47 kB -
29p5-xa4jmdhg.js gzip N/A 13.7 kB -
2lpk5_hknut8q.js gzip N/A 13.1 kB -
2o4cibp3awtbw.js gzip N/A 3.56 kB -
2q0rrh7fdtey-.js gzip N/A 157 B -
2tousq11u689-.js gzip N/A 161 B -
2ugc69z0t0ypz.js gzip N/A 1.46 kB -
2vn4-juoy27qc.js gzip N/A 65.6 kB -
2we2htu1n5wen.js gzip N/A 167 B -
2yq2jmanh6g9r.js gzip N/A 71.6 kB -
3-_0ow7671xjh.js gzip N/A 7.55 kB -
3622yd0n93ey1.js gzip N/A 156 B -
36dn8i-_3dnq5.js gzip N/A 10 kB -
37y_bgn93nr4z.js gzip N/A 156 B -
3aomptn8mfhl-.js gzip N/A 150 B -
3fljpmwcjxqhx.js gzip N/A 10.3 kB -
3gz44skqdlsrb.js gzip N/A 8.71 kB -
3wz8k38x902se.js gzip N/A 155 B -
3y9tus7kb5su0.js gzip N/A 13.3 kB -
42bwwsa14g3c7.js gzip N/A 156 B -
Total 401 kB 401 kB ✅ -15 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 1.06 kB 1.06 kB
Total 1.06 kB 1.06 kB
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 880 B 876 B
Total 880 B 876 B ✅ -4 B
Build Cache
Canary PR Change
00000001.sst gzip 13.1 MB 14.1 MB 🔴 +998 kB (+8%)
00000002.sst gzip 12 MB 13.4 MB 🔴 +1.35 MB (+11%)
00000003.sst gzip 15.7 MB 13.2 MB 🟢 2.48 MB (-16%)
00000004.sst gzip 14.3 MB 14.4 MB 🔴 +87.7 kB (+1%)
00000005.sst gzip 2.8 MB 2.8 MB
00000006.sst gzip 10.2 MB 10.2 MB
00000007.sst gzip 59 B 59 B
00000008.meta gzip 89 B 89 B
00000009.meta gzip 298 kB 298 kB
00000010.meta gzip 298 kB 298 kB
00000011.meta gzip 298 kB 298 kB
00000012.sst gzip 51.4 kB 51 kB
00000013.sst gzip 1.78 MB 1.8 MB 🔴 +16.7 kB (+1%)
00000014.sst gzip 59 B 59 B
00000015.meta gzip 116 B 116 B
00000016.meta gzip 326 kB 326 kB
00000017.meta gzip 404 kB 405 kB
00000018.sst gzip 52.2 kB 51.7 kB
00000019.sst gzip 1.4 MB 1.38 MB 🟢 12.8 kB (-1%)
00000020.sst gzip 59 B 59 B
00000021.meta gzip 116 B 116 B
00000022.meta gzip 326 kB 326 kB
00000023.meta gzip 372 kB 372 kB
00000024.sst gzip 52.3 kB 51.7 kB 🟢 583 B (-1%)
00000025.sst gzip 1.4 MB 1.38 MB 🟢 11.3 kB (-1%)
00000026.sst gzip 59 B 59 B
00000027.meta gzip 116 B 116 B
00000028.meta gzip 326 kB 326 kB
00000029.meta gzip 372 kB 372 kB
00000030.sst gzip 51.6 kB 51.2 kB
00000031.sst gzip 1.4 MB 1.38 MB 🟢 11.2 kB (-1%)
00000032.sst gzip 59 B 59 B
00000033.meta gzip 116 B 116 B
00000034.meta gzip 326 kB 326 kB
00000035.meta gzip 372 kB 372 kB
00000036.sst gzip 52.2 kB 51.8 kB
00000037.sst gzip 1.4 MB 1.38 MB 🟢 11.1 kB (-1%)
00000038.sst gzip 59 B 59 B
00000039.meta gzip 116 B 116 B
00000040.meta gzip 326 kB 326 kB
00000041.meta gzip 372 kB 372 kB
CURRENT gzip 24 B 24 B
LOG gzip 686 B 667 B 🟢 19 B (-3%)
Total 80.1 MB 80 MB ✅ -76.1 kB

📦 Webpack

Client

Main Bundles
Canary PR Change
3322-HASH.js gzip 66.1 kB N/A -
4191.HASH.js gzip 169 B N/A -
7920-HASH.js gzip 4.67 kB N/A -
9784-HASH.js gzip 5.63 kB N/A -
b1ad9f4c-HASH.js gzip 63.2 kB N/A -
framework-HASH.js gzip 59.7 kB 59.7 kB
main-app-HASH.js gzip 252 B 252 B
main-HASH.js gzip 40.1 kB 40.1 kB
webpack-HASH.js gzip 1.68 kB 1.68 kB
3577.HASH.js gzip N/A 168 B -
578-HASH.js gzip N/A 66.8 kB -
8590-HASH.js gzip N/A 5.61 kB -
9750-HASH.js gzip N/A 4.68 kB -
a8984546-HASH.js gzip N/A 63.2 kB -
Total 242 kB 242 kB ⚠️ +630 B
Polyfills
Canary PR Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Total 39.4 kB 39.4 kB
Pages
Canary PR Change
_app-HASH.js gzip 194 B 193 B
_error-HASH.js gzip 181 B 182 B
css-HASH.js gzip 334 B 331 B
dynamic-HASH.js gzip 1.81 kB 1.81 kB
edge-ssr-HASH.js gzip 255 B 253 B
head-HASH.js gzip 349 B 351 B
hooks-HASH.js gzip 382 B 384 B
image-HASH.js gzip 581 B 582 B
index-HASH.js gzip 260 B 259 B
link-HASH.js gzip 2.48 kB 2.48 kB
routerDirect..HASH.js gzip 317 B 318 B
script-HASH.js gzip 384 B 386 B
withRouter-HASH.js gzip 316 B 315 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.95 kB 7.96 kB ⚠️ +4 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 129 kB 128 kB
page.js gzip 293 kB 294 kB
Total 422 kB 422 kB ⚠️ +51 B
Middleware
Canary PR Change
middleware-b..fest.js gzip 617 B 616 B
middleware-r..fest.js gzip 156 B 156 B
middleware.js gzip 45.5 kB 45.2 kB
edge-runtime..pack.js gzip 842 B 842 B
Total 47.1 kB 46.8 kB ✅ -306 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 717 B 718 B
Total 717 B 718 B ⚠️ +1 B
Build Cache
Canary PR Change
0.pack gzip 4.8 MB 4.79 MB 🟢 8.91 kB (0%)
index.pack gzip 121 kB 124 kB 🔴 +2.5 kB (+2%)
index.pack.old gzip 122 kB 123 kB
Total 5.04 MB 5.04 MB ✅ -5.36 kB

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 374 kB 374 kB
app-page-exp..prod.js gzip 207 kB 207 kB
app-page-tur...dev.js gzip 374 kB 374 kB
app-page-tur..prod.js gzip 206 kB 206 kB
app-page-tur...dev.js gzip 370 kB 370 kB
app-page-tur..prod.js gzip 204 kB 204 kB
app-page.run...dev.js gzip 371 kB 371 kB
app-page.run..prod.js gzip 204 kB 204 kB
app-route-ex...dev.js gzip 82.6 kB 82.6 kB
app-route-ex..prod.js gzip 55.8 kB 55.8 kB
app-route-tu...dev.js gzip 82.7 kB 82.7 kB
app-route-tu..prod.js gzip 55.8 kB 55.8 kB
app-route-tu...dev.js gzip 82.3 kB 82.3 kB
app-route-tu..prod.js gzip 55.6 kB 55.6 kB
app-route.ru...dev.js gzip 82.2 kB 82.2 kB
app-route.ru..prod.js gzip 55.6 kB 55.6 kB
dev-validati...dev.js gzip 134 kB 134 kB
dev-validati...dev.js gzip 134 kB 134 kB
dev-validati...dev.js gzip 131 kB 131 kB
dev-validati...dev.js gzip 131 kB 131 kB
dist_client_...dev.js gzip 324 B 324 B
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 318 B 318 B
dist_client_...dev.js gzip 317 B 317 B
pages-api-tu...dev.js gzip 46.1 kB 46.1 kB
pages-api-tu..prod.js gzip 34.3 kB 34.3 kB
pages-api.ru...dev.js gzip 46 kB 46 kB
pages-api.ru..prod.js gzip 34.3 kB 34.3 kB
pages-turbo....dev.js gzip 54.8 kB 54.8 kB
pages-turbo...prod.js gzip 39.8 kB 39.8 kB
pages.runtim...dev.js gzip 54.8 kB 54.8 kB
pages.runtim..prod.js gzip 39.8 kB 39.8 kB
server.runti..prod.js gzip 66.7 kB 66.7 kB
use-cache-pr...dev.js gzip 72.3 kB 72.3 kB
use-cache-pr...dev.js gzip 72.3 kB 72.3 kB
use-cache-pr...dev.js gzip 70.6 kB 70.6 kB
use-cache-pr...dev.js gzip 70.5 kB 70.5 kB
Total 4.1 MB 4.1 MB ⚠️ +5 B
📝 Changed Files (1 file)

Files with changes:

  • server.runtime.prod.js
View diffs
server.runtime.prod.js

Diff too large to display

📎 Tarball URL
https://vercel-packages.vercel.app/next/commits/9bd01fa5aaa02e2d42d9bdf2dddf7110ab297f9e/next

Commit: 9bd01fa

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Failing test suites

Commit: 9bd01fa | About building and testing Next.js

pnpm test-dev-experimental-turbo test/e2e/app-dir/strict-route-matching-known-limitations/strict-route-matching-known-limitations.test.ts (turbopack) (Experimental) (job)

  • strict-route-matching-known-limitations > metadata error delivery > documents that metadata errors are swallowed on initial load (DD)
  • strict-route-matching-known-limitations > metadata error delivery > documents that a metadata redirect is swallowed only on initial load (DD)
Expand output

● strict-route-matching-known-limitations › metadata error delivery › documents that metadata errors are swallowed on initial load

page.waitForSelector: Timeout 5000ms exceeded.
Call log:
  - waiting for locator('#root-error') to be visible

  556 |
  557 |     return this.startChain(async () => {
> 558 |       const el = await page.waitForSelector(selector, {
      |                             ^
  559 |         timeout,
  560 |         state,
  561 |       })

  at waitForSelector (lib/browsers/playwright.ts:558:29)
  at Playwright._chain (lib/browsers/playwright.ts:688:23)
  at Playwright._chain [as startChain] (lib/browsers/playwright.ts:669:17)
  at Playwright.startChain [as waitForElementByCss] (lib/browsers/playwright.ts:557:17)
  at Playwright.waitForElementByCss [as elementByCss] (lib/browsers/playwright.ts:442:17)
  at Object.elementByCss (e2e/app-dir/strict-route-matching-known-limitations/strict-route-matching-known-limitations.test.ts:149:33)
  at Proxy._chain (lib/browsers/playwright.ts:688:23)
  at Proxy._chain (lib/browsers/playwright.ts:664:17)
  at Proxy.continueChain (lib/browsers/playwright.ts:470:17)
  at Object.text (e2e/app-dir/strict-route-matching-known-limitations/strict-route-matching-known-limitations.test.ts:149:61)

● strict-route-matching-known-limitations › metadata error delivery › documents that a metadata redirect is swallowed only on initial load

expect(received).toBe(expected) // Object.is equality

Expected: "/success"
Received: "/metadata-redirect"

  170 |         await createBrowserWithAct('/other')
  171 |       await navigate(navigationBrowser, act, '/metadata-redirect')
> 172 |       expect(new URL(await navigationBrowser.url()).pathname).toBe('/success')
      |                                                               ^
  173 |       expect(
  174 |         await navigationBrowser.elementByCss('#named-slot-page').text()
  175 |       ).toBe('Named slot page: success')

  at Object.toBe (e2e/app-dir/strict-route-matching-known-limitations/strict-route-matching-known-limitations.test.ts:172:63)

Other failing CI jobs

@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch 12 times, most recently from db528b7 to 9228c2f Compare August 10, 2026 22:54
const nextConfig = {}
const nextConfig = {
experimental: {
pruneUnmatchedParallelRoutes: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to update this test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah because the unflagged behavior (should be) a superset of the flagged behavior so it is asserting that interception routes still work with the default null behavior that exists when parallel slots do not have children during soft nav. Though it does suggest the main test suite actually should get this coverage too

@ztanner ztanner Aug 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, or maybe we enable it in the existing matrix that we have that turns other flags on? Then coverage is broad across the different parallel route/interception tests. I think that's how we handled the new scroll handler, too.

@@ -0,0 +1,163 @@
import { nextTestSetup } from 'e2e-utils'

describe('parallel-routes-pruned-matchers', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we assert that a client nav 404s in addition to hard refresh?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good call

@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch from d279411 to 8e963bd Compare August 11, 2026 16:01
@gnoff
gnoff changed the base branch from canary to jstory/omit-implicit-children-slots August 11, 2026 16:02
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch 2 times, most recently from 65edfc5 to cf7c828 Compare August 11, 2026 16:51
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch from cf7c828 to 560ca01 Compare August 11, 2026 18:02
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch from 560ca01 to 6eda652 Compare August 11, 2026 18:27
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch 2 times, most recently from 03769c6 to 6403e32 Compare August 11, 2026 21:26
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch from 6403e32 to 10129ba Compare August 11, 2026 21:30
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch 2 times, most recently from 9c8393c to e3a9ee5 Compare August 11, 2026 22:07
gnoff added 3 commits August 11, 2026 15:30
This extends experimental.strictRouteMatching so a matcher is left out when its loader tree contains a synthesized default that will always call notFound(). More specific matchers that combine the catchall with pages in other slots are still included, and adding a default.tsx keeps the broader matcher.

The main goal is to make children and named slots behave the same way. If a URL cannot construct a complete route tree on its own, it should be treated as an unmatched URL instead of sometimes showing a slot 404 and sometimes producing a missing page or default error.

We got here incrementally. [#47872](#47872) introduced the 404 fallback for unmatched parallel slots, [#60186](#60186) added a development warning because this was confusing in practice and linked [#51805](#51805) and [#49569](#49569), and [#84702](#84702) later made a missing default a build error for named slots while leaving children on the old fallback for backwards compatibility. Strict matching takes the next step and treats a matcher that can only construct a permanent 404 tree as unmatched.

This changes soft navigations that only worked by preserving a previously active slot even though the URL could not be loaded directly, which is why it is part of the experimental strict matching behavior. Interception routes that use the null fallback added in [#85779](#85779) are left alone. This change however is well motivated because if you did client nav to a route that only matches a named slot and then hard refresh you will end up getting a 404. This is a sign our current semantics are actually broken.

If you want to preserve the perma 404 behavior of the slot-without-default you can just add a default and make it call notFound() unconditionally.
Parallel route layouts do not have to render children. A layout can be composed entirely from named slots, in which case the synthesized children not-found fallback is never rendered and should not make the route incomplete.

This tracks whether children is actually declared by a page, default, or ordinary descendant before considering its fallback during pruning. It keeps concrete named-only matches while still pruning broader catchalls when a declared named slot or children branch does not match.
@gnoff
gnoff force-pushed the jstory/prune-incomplete-matchers branch from e3a9ee5 to 9bd01fa Compare August 11, 2026 22:30

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

containsRenderableRoute/hasDeclaredChildrenSlot register their webpack context dependency inside a compilation-shared cache body, so modules that hit the cache never register the directory dependency and become stale in dev/watch mode.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants