Merge pull request #57 from abhi1693/fix/next-allowed-dev-origins

fix(frontend): allow localhost dev origins
This commit is contained in:
Abhimanyu Saharan
2026-02-08 00:53:02 +05:30
committed by GitHub
2 changed files with 11 additions and 4 deletions

View File

@@ -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 ### 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 youre 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 wont connect.

View File

@@ -1,7 +1,11 @@
import type { NextConfig } from "next"; import type { NextConfig } from "next";
const nextConfig: NextConfig = { 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: { images: {
remotePatterns: [ remotePatterns: [
{ {