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
3a2316ff
Commit
3a2316ff
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: use consistent endsWith pattern for PARALLEL_ROUTE_DEFAULT_PATH
parent
c9fd7fd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
create-flight-router-state-from-loader-tree.ts
...app-render/create-flight-router-state-from-loader-tree.ts
+3
-6
No files found.
packages/next/src/server/app-render/create-flight-router-state-from-loader-tree.ts
View file @
3a2316ff
...
@@ -102,17 +102,14 @@ async function createFlightRouterStateFromLoaderTreeImpl(
...
@@ -102,17 +102,14 @@ async function createFlightRouterStateFromLoaderTreeImpl(
// that calls notFound(). This tells the client router not to reuse the
// that calls notFound(). This tells the client router not to reuse the
// previous page content when navigating to a URL with no matching page.
// previous page content when navigating to a URL with no matching page.
// The path comparison uses endsWith because the loader tree stores
// The path comparison uses endsWith because the loader tree stores
//
absolute filesystem paths while PARALLEL_ROUTE_DEFAULT_PATH is a
//
paths that may include a prefix before the package-relative portion
//
package-relative path
(e.g., "next/dist/client/components/builtin/default.js").
// (e.g., "next/dist/client/components/builtin/default.js").
if
(
segment
===
DEFAULT_SEGMENT_KEY
)
{
if
(
segment
===
DEFAULT_SEGMENT_KEY
)
{
const
{
defaultPage
}
=
loaderTree
[
2
]
const
{
defaultPage
}
=
loaderTree
[
2
]
if
(
if
(
defaultPage
!==
undefined
&&
defaultPage
!==
undefined
&&
typeof
defaultPage
[
1
]
===
'string'
&&
typeof
defaultPage
[
1
]
===
'string'
&&
defaultPage
[
1
].
endsWith
(
defaultPage
[
1
].
endsWith
(
PARALLEL_ROUTE_DEFAULT_PATH
)
// Strip the leading "next/" from the constant to match absolute paths.
PARALLEL_ROUTE_DEFAULT_PATH
.
slice
(
'next/'
.
length
)
)
)
{
)
{
prefetchHints
|=
PrefetchHint
.
IsBuiltinNotFoundDefault
prefetchHints
|=
PrefetchHint
.
IsBuiltinNotFoundDefault
}
}
...
...
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