Using redirect
to the redirect to the same path within server actions causes the page to do a browser refresh when using runtime = edge
#54030
Labels
bug
Issue was opened via the bug report template.
Linking and Navigating
Related to Next.js linking (e.g., <Link>) and navigation.
stale
The issue has not seen recent activity.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.0.0: Tue Aug 1 03:25:17 PDT 2023; root:xnu-10002.0.242.0.6~31/RELEASE_ARM64_T8103 Binaries: Node: 18.16.0 npm: 9.5.1 Yarn: 1.22.19 pnpm: 8.6.7 Relevant Packages: next: 13.4.15 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Fredkiss3/next-redirect-cache-bug/tree/another-bug
To Reproduce
redirect To /
it will submit a form which redirects you to the same page, you will see a browser refreshredirect To /target
it will submit a form which redirects you to/target
page you won't see a browser refreshEnregistrement.de.l.ecran.2023-08-15.a.00.14.36.mov
Describe the Bug
When calling redirect to the same page inside a server action, nextjs does a full browser refresh, while redirecting to another page does not.
This only happens when using edge runtime.
Expected Behavior
It should not do a browser refresh but a client-side navigation.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: