[🐛 Bug]: Using `redirect` in actions causes errors in `wrangler pages dev`
next-on-pages environment related information
System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000
CPU: (10) arm64 Apple M1 Pro
Memory: 32 GB
Shell: /bin/zsh
Package Manager Used: npm (10.2.4)
Relevant Packages:
@cloudflare/next-on-pages: 1.11.0
vercel: 33.6.1
next: 14.1.0
Description
Using the Next.js' built-in redirect method in server actions seems to break wrangler pages dev
Thankfully the issue doesn't appear in the deployed application
Reproduction
https://github.com/dario-piotrowicz/next-on-pages-redirect-issue-repro
Additional Information
This seems likely to me a wrangler issue, we should likely move it to the workers-sdk repository, I am adding it here just to keep track of it and investigate it further, it should be moved to workers-sdk if it ends up actually being a wrangler specific issue
@dario-piotrowicz any updates on this issue?
Hi @yusuf8ahmed 🙂
Sorry no updates, actually next-on-pages is a bit in maintenance mode right now (and I am not actively working on it) and official efforts from the Cloudflare team have been shifted onto our open-next adapter: https://github.com/opennextjs/opennextjs-cloudflare have you tried that by any chance?
Hi @dario-piotrowicz
I am planning on moving to opennextjs-cloudflare but I'm worried since it not ready for production yet. Is there anything that I could do as a stop gap solution?
Also off topic question, If I can't use redirect in wrangler pages dev. How would KV work when using next dev, Currently for D1 I am using a work around where I point to a local db when running next dev?
I am planning on moving to opennextjs-cloudflare but I'm worried since it not ready for production yet. Is there anything that I could do as a stop gap solution?
I'm sorry unfortunately I don't think there is a stop gap solution right now 😓
Also off topic question, If I can't use redirect in
wrangler pages dev. How would KV work when usingnext dev, Currently for D1 I am using a work around where I point to a local db when runningnext dev?
Sorry I'm not completely sure I follow the question 😕 Are you asking how to use production values when running your application locally? (if that's the question, we don't currently have a solution for that but the team is working on one 🥲)
(PS: since this is off topic here, if you want to move the conversation onto discord feel free to ping me somewhere there 🙂 (https://discord.com/invite/cloudflaredev) )
Also off topic question, If I can't use redirect in
wrangler pages dev. How would KV work when usingnext dev, Currently for D1 I am using a work around where I point to a local db when runningnext dev?Sorry I'm not completely sure I follow the question 😕 Are you asking how to use production values when running your application locally? (if that's the question, we don't currently have a solution for that but the team is working on one 🥲)
(PS: since this is off topic here, if you want to move the conversation onto discord feel free to ping me somewhere there 🙂 (https://discord.com/invite/cloudflaredev) )
No problem thank you very much for the help.
The open-next adapter is (and has been for a while) stable , hopefully that addresses this issue 😄