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
aa5e44d4
Commit
aa5e44d4
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ensure deterministic metadata resolution order for parallel routes
parent
daca04d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
resolve-metadata.ts
packages/next/src/lib/metadata/resolve-metadata.ts
+16
-2
No files found.
packages/next/src/lib/metadata/resolve-metadata.ts
View file @
aa5e44d4
...
@@ -788,7 +788,14 @@ async function resolveMetadataItemsImpl(
...
@@ -788,7 +788,14 @@ async function resolveMetadataItemsImpl(
.
join
(
'/'
),
.
join
(
'/'
),
})
})
for
(
const
key
in
parallelRoutes
)
{
// Process children first, then other parallel routes, for consistent ordering
const
metadataParallelRouteKeys
=
Object
.
keys
(
parallelRoutes
)
metadataParallelRouteKeys
.
sort
((
a
,
b
)
=>
{
if
(
a
===
'children'
)
return
-
1
if
(
b
===
'children'
)
return
1
return
a
.
localeCompare
(
b
)
})
for
(
const
key
of
metadataParallelRouteKeys
)
{
const
childTree
=
parallelRoutes
[
key
]
const
childTree
=
parallelRoutes
[
key
]
await
resolveMetadataItemsImpl
(
await
resolveMetadataItemsImpl
(
metadataItems
,
metadataItems
,
...
@@ -911,7 +918,14 @@ async function resolveViewportItemsImpl(
...
@@ -911,7 +918,14 @@ async function resolveViewportItemsImpl(
.
join
(
'/'
),
.
join
(
'/'
),
})
})
for
(
const
key
in
parallelRoutes
)
{
// Process children first, then other parallel routes, for consistent ordering
const
viewportParallelRouteKeys
=
Object
.
keys
(
parallelRoutes
)
viewportParallelRouteKeys
.
sort
((
a
,
b
)
=>
{
if
(
a
===
'children'
)
return
-
1
if
(
b
===
'children'
)
return
1
return
a
.
localeCompare
(
b
)
})
for
(
const
key
of
viewportParallelRouteKeys
)
{
const
childTree
=
parallelRoutes
[
key
]
const
childTree
=
parallelRoutes
[
key
]
await
resolveViewportItemsImpl
(
await
resolveViewportItemsImpl
(
viewportItems
,
viewportItems
,
...
...
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