Skip to content

fix: stop account creation hanging in local dev - #10

Merged
devKojo merged 1 commit into
feat/portalsfrom
fix/dev-api-proxy-and-env
Nov 7, 2026
Merged

devKojo merged 1 commit into
feat/portalsfrom
fix/dev-api-proxy-and-env

Conversation

@enochboison

Copy link
Copy Markdown
Collaborator

Problem

Creating an account in local dev sat on "Creating your account..." forever.

Causes (reproduced in the browser)

  1. Proxy loop. devProxy targeted http://localhost:3000. Node resolves localhost to ::1 first. Docker Desktop holds port 3001, so Nuxt falls back to port 3000 on ::1 and the API (IPv4) is shadowed: /api/** was proxied to Nuxt itself and never answered. Fixed by defaulting the target to 127.0.0.1.
  2. API did not load .env. apps/api has dotenv but config/env.ts never called it, so npm run dev -w @imp/api crashed on DATABASE_URL. A stale API process (started before the identity module existed) kept serving only /health and /users, so /api/v1/auth/* returned 404 and the form showed "Something went wrong". Fixed by loading .env (cwd and repo root) in config/env.ts; real environment variables still win.

Verified

With both fixes, against a fresh API and a second Nuxt instance: POST /api/v1/auth/register-participant returned 202 and the app moved to "Check your email". Before: hang, then 404 against the stale API.

Needs action on your machine

Restart npm run dev. The running API process is stale and the running Nuxt still has the old config. Check that nothing else is bound to port 3000/3001 (netstat -ano | findstr :3001), or stop Docker's 3001 binding.

Full lint/typecheck/tests run in CI.

… env loading)

- Web dev proxy targeted "localhost", which Node resolves to ::1. When port 3001 is taken
  (Docker Desktop) Nuxt falls back to 3000 on ::1, so /api was proxied to Nuxt itself and every
  request hung. Default to 127.0.0.1.
- The API never loaded .env, so `npm run dev -w @imp/api` crashed on DATABASE_URL and a stale
  process kept serving an old route table (404 on /api/v1/auth/*). Load .env in config/env.ts.
@devKojo
devKojo merged commit cfd84a8 into feat/portals Nov 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants