You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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 withnext 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:
When doing the request
GET /
, you get the headerx-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?
The text was updated successfully, but these errors were encountered: