Open kuanjiahong opened 4 days ago
https://github.com/kuanjiahong/nextjs-middleware-redirect-issue-demo
Current behavior After clicking "Remove Session" and then clicking "My Server Action", the page is not redirected to "/set-cookie" page
Expected behaviour After clicking "Remove Session" and then clicking "My Server Action", the page should be redirected to "/set-cookie" page
Operating System: Platform: win32 Arch: x64 Version: Windows 11 Home Available memory (MB): 16086 Available CPU cores: 8 Binaries: Node: 22.11.0 npm: 10.9.0 Yarn: N/A pnpm: N/A Relevant Packages: next: 15.0.4-canary.27 // Latest available version is detected (15.0.4-canary.27). eslint-config-next: N/A react: 19.0.0-rc-b01722d5-20241114 react-dom: 19.0.0-rc-b01722d5-20241114 typescript: 5.3.3 Next.js Config: output: N/A
Middleware
next dev (local), next start (local)
I tested my reproduction on 15.0.4-canary.27 and also 15.0.3. The issues are reproduceable for both of these version.
this is better place delete cookie and redirect in same server action function
Link to the code that reproduces this issue
https://github.com/kuanjiahong/nextjs-middleware-redirect-issue-demo
To Reproduce
Current vs. Expected behavior
Current behavior After clicking "Remove Session" and then clicking "My Server Action", the page is not redirected to "/set-cookie" page
Expected behaviour After clicking "Remove Session" and then clicking "My Server Action", the page should be redirected to "/set-cookie" page
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
I tested my reproduction on 15.0.4-canary.27 and also 15.0.3. The issues are reproduceable for both of these version.