Files
supabase/apps/studio/compat/next/server.ts
T
Alaister Young 2428cfd3b5 chore(studio): shim next/server in Vite compat layer
Two App Router routes (incident-banner, incident-status) and a few
type-only uses elsewhere import from 'next/server'. The Vite
nextCompat guard was 500ing on the build. Shim exposes
NextResponse.json (the only value surface used) and a type alias
NextRequest = Request.
2026-04-21 19:14:15 +08:00

14 lines
630 B
TypeScript

// Vite-side compat for `next/server`. Workspace source uses `NextResponse`
// (only `.json()`) in two App Router routes and `NextRequest` as a type-only
// import elsewhere. Extend this file if more surface is needed.
export const NextResponse = {
json: (data: unknown, init?: ResponseInit) => Response.json(data, init),
}
// NextRequest extends Request with Next-specific fields (nextUrl, cookies,
// ip, geo). None of our workspace source reads those fields at runtime —
// the only imports are type-only. Aliasing to Request keeps TypeScript
// happy without pulling in Next internals.
export type NextRequest = Request