mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 11:25:06 +03:00
The Next pages-router build guards platform-only API routes via middleware (proxy.ts, Next 16's renamed middleware convention). TanStack Start has no middleware runtime, so that guard didn't run on the TanStack build at all. Add an equivalent global request middleware on a TanStack start instance (start.ts). On Vercel, /api/* and /_serverFn/* are rewritten to the api/server.js function which runs createStartHandler, so requestMiddleware executes server-side for every API request even though pages are a static SPA shell. Extract the shared HOSTED_SUPPORTED_API_URLS allowlist into lib/hosted-api-allowlist.ts so the Next and TanStack guards can't drift while both frameworks run in parallel.