Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
cfb17b03
Commit
cfb17b03
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: exclude catch-alls from dynamic guard and filter interception routes
parent
f0f1c03a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
app_structure.rs
crates/next-core/src/app_structure.rs
+5
-1
normalize-catchall-routes.ts
packages/next/src/build/normalize-catchall-routes.ts
+2
-1
No files found.
crates/next-core/src/app_structure.rs
View file @
cfb17b03
...
@@ -1354,7 +1354,11 @@ async fn directory_tree_to_loader_tree_internal(
...
@@ -1354,7 +1354,11 @@ async fn directory_tree_to_loader_tree_internal(
// However, if a static subdirectory at this level directly matches the
// However, if a static subdirectory at this level directly matches the
// target path, dynamic segment subdirectories should not use dynamic
// target path, dynamic segment subdirectories should not use dynamic
// matching (static routes take priority over dynamic ones).
// matching (static routes take priority over dynamic ones).
let
child_match_dynamic
=
if
has_static_match_at_this_level
// Catch-all directories (e.g. [...slug]) are also excluded from dynamic
// matching because they have their own catch-all matching logic.
let
child_match_dynamic
=
if
subdir_name
.contains
(
"..."
)
{
false
}
else
if
has_static_match_at_this_level
&&
is_dynamic_segment
(
subdir_name
)
&&
is_dynamic_segment
(
subdir_name
)
&&
parallel_route_key
.is_none
()
&&
parallel_route_key
.is_none
()
{
{
...
...
packages/next/src/build/normalize-catchall-routes.ts
View file @
cfb17b03
...
@@ -95,7 +95,8 @@ function normalizeDynamicRoutes(
...
@@ -95,7 +95,8 @@ function normalizeDynamicRoutes(
(
route
)
=>
(
route
)
=>
route
.
includes
(
'@'
)
&&
route
.
includes
(
'@'
)
&&
hasDynamicSegment
(
route
)
&&
hasDynamicSegment
(
route
)
&&
!
isCatchAllRoute
(
route
)
!
isCatchAllRoute
(
route
)
&&
!
isInterceptionRouteAppPath
(
route
)
)
)
// Prefer more specific (deeper) routes first.
// Prefer more specific (deeper) routes first.
.
sort
((
a
,
b
)
=>
b
.
split
(
'/'
).
length
-
a
.
split
(
'/'
).
length
)
.
sort
((
a
,
b
)
=>
b
.
split
(
'/'
).
length
-
a
.
split
(
'/'
).
length
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment