Stops the www proxy from running on Studio's non-document traffic. Each
chunk, server function and API request under `/dashboard` currently
invokes it, and a cold Studio load preloads a few hundred chunks through
this path.
**Changed:**
- The proxy matcher now skips `/dashboard/_vercel/`,
`/dashboard/_serverFn/` and `/dashboard/api/`
- Studio documents still match, so direct `/dashboard` landings keep
getting the `_sb_first_referrer` cookie and the paid-traffic refresh
**Added:**
- Matcher tests using Next's `unstable_doesMiddlewareMatch`. The three
skip cases fail against the old matcher
A quick single-region TTFB probe on production showed a www static file
that goes through the proxy about 15ms slower than one that skips it.
Rerun that comparison on this preview if you want a before/after.
## To test
On the www preview, replacing `<chunk>` with a real chunk path from the
page source:
- `curl -sI -H 'Referer: https://www.google.com/'
<preview>/dashboard/_vercel/immutable/<chunk>`: 200 with no `set-cookie:
_sb_first_referrer`
- `curl -sI -H 'Referer: https://www.google.com/'
<preview>/dashboard/sign-in`: still has `set-cookie: _sb_first_referrer`
- Load `/dashboard` in a browser and check Studio renders with no failed
chunk or API requests
- `curl -sI -H 'Accept: text/markdown' <preview>/pricing`: markdown
negotiation on www pages is unchanged
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
## Problem
After upgrading `www` to Next.js 16, Sentry reports `The router state
header was sent but could not be parsed` (WWW-63) on RSC requests such
as `/blog?_rsc=…`. Next 15 clients (the `docs` zone, which is still on
Next 15 and served under `/docs`, plus tabs opened before the deploy)
send a `Next-Router-State-Tree` header whose fifth element is a boolean,
while Next 16 requires a number, so the renderer throws and returns a
500.
## Solution
`proxy.ts` now detects the Next 15-shaped router state header and
returns a cheap `400` (`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
upgrading `apps/docs` to Next 16, after which this guard can be removed.
## Review instructions
1. Run `pnpm --filter=www test proxy.test.ts` and confirm the new
`Next.js 15 router state tree` tests pass.
2. After deploy, confirm WWW-63 stops receiving new events.
## 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 <noreply@anthropic.com>
## Problem
The marketing site (`apps/www`) is still on Next.js 15. Resolves
FE-4673.
## Solution
Upgrades `apps/www` to Next.js 16.3.6 (`next` now uses the workspace
catalog; `@next/mdx` and `@next/bundle-analyzer` are bumped to match).
Fixes for breaking changes: `middleware.ts` renamed to `proxy.ts`,
removed the `eslint` key from `next.config.mjs`, moved Sentry options
under `webpack`, and added `images.localPatterns` and
`images.qualities`. `dev` and `build:next` now run with `--webpack`,
because the MDX remark plugins have non-serializable options and
`esmExternals: 'loose'` is ignored by Turbopack.
## Review instructions
1. Run `pnpm --filter=www typecheck` and `pnpm --filter=www test`.
2. Run `pnpm dev:www` and open `/pricing` and `/blog/vector-buckets`;
both should render, including images.
3. Check the Vercel preview build. Locally, `next build` needed
`NODE_OPTIONS=--max-old-space-size=8192`, so confirm memory is
sufficient. `proxy.ts` now runs on the Node.js runtime instead of edge.
## Checklist
Check all before review:
- [ ] 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 <noreply@anthropic.com>