CLI to build and develop Next.js apps for Cloudflare Pages
### next-on-pages environment related information System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 CPU: (10) arm64 Apple M1 Pro Memory: 16 GB Shell: /bin/zsh Package Manager Used: bun (1.1.30) Relevant Packages: @cloudflare/next-on-pages: 1.13.5 vercel: N/A next: N/A ### Description I'm still trying to deep dive into the code of `next-on-pages` to understand, but it's reproducible when deploying to Cloudflare Pages, but working fine locally with `next dev`: In a middleware, when setting headers on the response after a `NextResponse.rewrite`, these headers are never sent to the end response. ### Reproduction (I'll provide a reproduction asap but wanted to see if people had idea on workaround first) With middleware that contains: ```ts const response = NextResponse.rewrite(target); response.headers.set('x-helloworld', 'hello'); return response; ``` When doing the request `GET /`, you get the header `x-helloworld`. But if you do the request as a router transition/prefetch (reproducible by passing the header `RCS: 1`), you don't get the header. ### Pages Deployment Method Direct Upload (`wrangler pages publish` or the @cloudflare/pages-action GitHub Action) ### Pages Deployment ID dd6d6274-8152-412a-8199-18bb44004a0f ### Additional Information _No response_ ### Would you like to help? - [X] Would you like to help fixing this bug?
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by SamyPesse and has received 1 comments.