-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix redirect under suspense boundary with basePath (#62597)
Fixes `redirect()` call under suspense boundary, redirect url should include the `basePath` in the url. `redirect()` under suspense boundaries will go through server html insertion, which is being used every time by suspense boundary resolved, new errors will triggered from SSR streaming. It was missing before. Fixes NEXT-2615 Fixes #62407
- Loading branch information
Showing
5 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Have loading.js to trigger suspense boundary for /dynamic/[id] page | ||
export default function Loading() { | ||
return <div>loading</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { redirect } from 'next/navigation' | ||
|
||
export default async function Page({ params: { id } }) { | ||
if (id === 'source') redirect('/dynamic/dest') | ||
|
||
return ( | ||
<div> | ||
<p>{`id:${id}`}</p> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters