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
3111aea6
Commit
3111aea6
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: also clear nextUrl in navigate-reducer for same-URL navigation
parent
7514f747
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
navigate-reducer.ts
...nt/components/router-reducer/reducers/navigate-reducer.ts
+8
-1
No files found.
packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts
View file @
3111aea6
...
@@ -41,6 +41,13 @@ export function navigateReducer(
...
@@ -41,6 +41,13 @@ export function navigateReducer(
// state machine.
// state machine.
const
currentUrl
=
new
URL
(
state
.
canonicalUrl
,
location
.
origin
)
const
currentUrl
=
new
URL
(
state
.
canonicalUrl
,
location
.
origin
)
const
currentRenderedSearch
=
state
.
renderedSearch
const
currentRenderedSearch
=
state
.
renderedSearch
// Clear nextUrl for same-page navigations to avoid re-triggering
// interception rewrites. When the user navigates to the same URL they're
// already on, we should not send the Next-Url header that would cause the
// server to apply interception rewrites again.
const
nextUrl
=
url
.
href
===
currentUrl
.
href
?
null
:
state
.
nextUrl
return
navigateUsingSegmentCache
(
return
navigateUsingSegmentCache
(
state
,
state
,
url
,
url
,
...
@@ -48,7 +55,7 @@ export function navigateReducer(
...
@@ -48,7 +55,7 @@ export function navigateReducer(
currentRenderedSearch
,
currentRenderedSearch
,
state
.
cache
,
state
.
cache
,
state
.
tree
,
state
.
tree
,
state
.
nextUrl
,
nextUrl
,
FreshnessPolicy
.
Default
,
FreshnessPolicy
.
Default
,
scrollBehavior
,
scrollBehavior
,
navigateType
navigateType
...
...
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