import type { NextConfig } from "next"; import { networkInterfaces } from "os"; // Next.js 16's dev server blocks cross-origin access to dev-only resources // (the HMR websocket, etc.) unless the origin is allowlisted - which silently // breaks hydration when testing from a real phone over WiFi, since the phone's // origin is the dev machine's LAN IP, never "localhost". Derived dynamically // because DHCP can hand out a different IP on a later session. Only affects // `next dev`. Copied from nachklang-feedback. const lanIps = Object.values(networkInterfaces()) .flat() .filter((iface): iface is NonNullable => !!iface && iface.family === "IPv4" && !iface.internal) .map((iface) => iface.address); const nextConfig: NextConfig = { // Self-contained server.js for Plesk's Passenger Node.js toolkit, the same // way nachklang-feedback is deployed. output: "standalone", allowedDevOrigins: lanIps, turbopack: { root: __dirname, }, }; export default nextConfig;