Fix dev server hang (broken dev script + IPv6 proxy stall)

`pnpm dev` never started the backend: the server dev script ran
`node --experimental-strip-types src/index.ts`, but type-stripping doesn't
rewrite the `.js` import specifiers to `.ts`, so it crashed on
ERR_MODULE_NOT_FOUND. With no backend on :3000, the Vite proxy waited the full
timeout on every /api call — the "Loading…" and "Signing in…" hangs.

- server dev script -> `tsx watch` (resolves .js->.ts, has built-in watch).
- Vite proxy targets 127.0.0.1 (not "localhost") so it never tries IPv6 ::1
  first and stall — the backend binds IPv4. Belt-and-suspenders for the same
  hang, notably under WSL2 mirrored networking.

Verified: pnpm dev boots the backend; health/auth/me ~5ms; browser login is
instant (was minutes).
This commit is contained in:
2026-06-14 11:27:07 +02:00
parent 64d5e45f11
commit 2d55d40405
3 changed files with 10 additions and 3 deletions
+5 -2
View File
@@ -9,8 +9,11 @@ export default defineConfig({
server: {
port: 5173,
proxy: {
"/api": "http://localhost:3000",
"/health": "http://localhost:3000",
// Use 127.0.0.1 (not "localhost") so the proxy never tries IPv6 ::1
// first and stall — the backend binds IPv4. Avoids slow/hung requests,
// notably under WSL2 mirrored networking.
"/api": "http://127.0.0.1:3000",
"/health": "http://127.0.0.1:3000",
},
},
build: {