diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 6bd62bd..c6c37fb 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,6 +1,18 @@ import type { NextConfig } from "next"; +// Hosts allowed to load /_next/* dev resources from this dev server. +// Next.js 16 blocks cross-origin dev requests by default; without this, +// running `next dev` behind any reverse proxy or non-localhost origin +// silently breaks HMR and React hydration. +// Set ALLOWED_DEV_ORIGINS as a comma-separated list, e.g. +// ALLOWED_DEV_ORIGINS=bigset.example.com,staging.example.com +const allowedDevOrigins = (process.env.ALLOWED_DEV_ORIGINS || "") + .split(",") + .map((s) => s.trim()) + .filter(Boolean); + const nextConfig: NextConfig = { + allowedDevOrigins, async rewrites() { return [ {