diff --git a/frontend/README.md b/frontend/README.md index 09e5074..0f0a32f 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -157,8 +157,11 @@ Clerk should be **off** unless you set a real `pk_test_...` or `pk_live_...` pub ### Dev server blocked by origin restrictions -`next.config.ts` sets: +`next.config.ts` sets `allowedDevOrigins` for dev proxy safety. -- `allowedDevOrigins: ["192.168.1.101"]` +If you see repeated proxy errors (often `ECONNRESET`), make sure your dev server hostname and browser URL match (e.g. `localhost` vs `127.0.0.1`), and that your origin is included in `allowedDevOrigins`. -If you’re developing from a different hostname/IP, you may need to update `allowedDevOrigins` (or use `npm run dev` on localhost). +Notes: +- Local dev should work via `http://localhost:3000` and `http://127.0.0.1:3000`. +- LAN dev should work via the configured LAN IP (e.g. `http://192.168.1.101:3000`) **only** if you bind the dev server to all interfaces (`npm run dev:lan`). +- If you bind Next to `127.0.0.1` only, remote LAN clients won’t connect. diff --git a/frontend/next.config.ts b/frontend/next.config.ts index e594f65..8c034bc 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,7 +1,11 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - allowedDevOrigins: ["192.168.1.101"], + // In dev, Next may proxy requests based on the request origin/host. + // Allow common local origins so `next dev --hostname 127.0.0.1` works + // when users access via http://localhost:3000 or http://127.0.0.1:3000. + // Keep the LAN IP as well for dev on the local network. + allowedDevOrigins: ["192.168.1.101", "localhost", "127.0.0.1"], images: { remotePatterns: [ {