Hi NextJS team,
I am writing to bring urgent attention to a confirmed Next.js routing bug that heavily impacts production builds but has stalled in triage.
- GitHub Issue: https://github.com/vercel/next.js/issues/82117
- Internal Vercel Tracking ID:
linear: next/NEXT-4749 - Affected Versions: Next.js 15.4.1 and newer
🚨 The Problem & Production Impact
When redirect or permanentRedirect, Next.js duplicates the Location and x-nextjs-stale-time headers.
Instead of a clean redirect to /redirect, browsers and CDNs receive a malformed header, attempting to route users to /redirect,/redirect. This completely breaks user experience, navigation flows, and SEO indexing for any statically optimized redirect routes.
🔍 Root Cause Already Identified
The community has already done the heavy lifting and isolated the exact lines causing this in the core repository:
app-render/action-handler.tsinvokesres.setHeader('Location', redirectUrl).- Later,
templates/app-page.tsuses a nativeres.appendHeader()loop oncachedData.headerswithout checking for existing keys, directly duplicating the field.
This issue is already tracked internally under NEXT-4749, but it has not seen engineering activity. Because this breaks core framework routing behavior out of the box, could a member of the team look into scheduling a fix or reviewing a community PR for this?
Thank you very much