Calling redirect("./")
from server action updates route to ./
but with page content from /
#71906
Labels
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://github.com/sam3d/next-redirect-bug
To Reproduce
next dev
http://localhost:3000/hello/world
./
Current vs. Expected behavior
Calling
redirect("./")
in a server action on/hello/world
I'd expect the following page to be/hello
However upon clicking I get redirected to
/hello/
(with a forward slash) on the client router and the page content contains/
instead of the content of/hello
Then if I refresh the content of
/hello
is loaded correctly and the trailing forward slash is strippedThis issue doesn't occur if JavaScript is disabled.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:51:54 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 20.11.1 npm: 10.2.4 Yarn: N/A pnpm: 8.15.7 Relevant Packages: next: 15.0.2-canary.7 // Latest available version is detected (15.0.2-canary.7). eslint-config-next: 15.0.1 react: 19.0.0-rc-69d4b800-20241021 react-dom: 19.0.0-rc-69d4b800-20241021 typescript: 5.6.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: