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
git clone https://github.com/clmnin/cf-middleware-set-header.git
cd cf-middleware-set-header
npm i
Run NextJS Dev to see what are the expected outputs
npm run dev
# console log "token-value" for the middleware, page and layout# ▲ Next.js 14.1.0# - Local: http://localhost:3000# 1. middleware: token-value# 2. page: token-value# 3. layout: token-value
This is the expected output for a next js app. The page and layout routes get the response passed by the middleware.
Run Cloudflare pages preview using wrangler
npm run preview
# fails to console log "token-value" for the middleware, page and layout# [wrangler:inf] Ready on http://localhost:8788# 1. middleware: token-value# 2. page: null# 3. layout: null
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
Would you like to help fixing this bug?
The text was updated successfully, but these errors were encountered:
next-on-pages environment related information
System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.5.0: Wed May 1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020
CPU: (10) arm64 Apple M2 Pro
Memory: 16 GB
Shell: /bin/zsh
Package Manager Used: npm (10.5.0)
Relevant Packages:
@cloudflare/next-on-pages: 1.11.3
vercel: 34.2.4
next: 14.1.0
Description
Cloudflare next-on-pages fails to read header in next js pages/layout after setting it in the middleware.
Reproduction
I have created a minimal reproducible example in this repo - clmnin/cf-middleware-set-header
How to set it up
git clone https://github.com/clmnin/cf-middleware-set-header.git cd cf-middleware-set-header npm i
Run NextJS Dev to see what are the expected outputs
This is the expected output for a next js app. The page and layout routes get the response passed by the middleware.
Run Cloudflare pages preview using wrangler
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: