Repository navigation
fix(www): reject Next.js 15 router state headers in proxy - #52071
Conversation
Next 15 clients (the docs zone, stale tabs) send a router state tree whose fifth element is a boolean; Next 16 requires a number and throws a 500. Return a 400 from the proxy so the client falls back to a full page load. Fixes WWW-63 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
## Problem #52071 added a guard in the www proxy that rejects Next.js 15 router state headers, because the docs zone still ran Next.js 15. The docs upgrade to Next.js 16 (#52045) has merged, so the guard is no longer needed. Resolves [FE-4685](https://linear.app/supabase/issue/FE-4685/revert-nextjs-15-router-header-guard-after-pr-52045-merges). ## Solution Reverts #52071: removes the legacy router state tree check and the `OTHER_ZONE_PREFIXES` list from `apps/www/proxy.ts`, along with its tests in `apps/www/proxy.test.ts`. ## Review instructions 1. Confirm the diff matches the inverse of #52071. 2. Run `pnpm --filter=www exec vitest run proxy.test.ts` and see it pass. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Problem
After upgrading
wwwto Next.js 16, Sentry reportsThe router state header was sent but could not be parsed(WWW-63) on RSC requests such as/blog?_rsc=…. Next 15 clients (thedocszone, which is still on Next 15 and served under/docs, plus tabs opened before the deploy) send aNext-Router-State-Treeheader whose fifth element is a boolean, while Next 16 requires a number, so the renderer throws and returns a 500.Solution
proxy.tsnow detects the Next 15-shaped router state header and returns a cheap400(no-store) before it reaches the renderer, for paths www serves itself. Paths rewritten to other zones (/docs,/dashboard,/kb, …) are exempt, because the docs zone is Next 15 and its own client navigations must pass through untouched. The Next 15 router falls back to a full page load on any non-RSC response, which is the same outcome users get today after the 500, minus the error noise and wasted renders. Unit tests cover the v15 shape, the v16 shape, a missing header and a malformed header. The proper long-term fix is upgradingapps/docsto Next 16, after which this guard can be removed.Review instructions
pnpm --filter=www test proxy.test.tsand confirm the newNext.js 15 router state treetests pass.Checklist
Check all before review:
/write-the-docsor/edit-the-docsskill, which applies the docs style guide🤖 Generated with Claude Code