From 5e8b09f6e22574d1b60c04828c657608c6846ea2 Mon Sep 17 00:00:00 2001 From: aarbit Date: Sun, 6 Sep 2026 23:04:07 -0500 Subject: [PATCH] Fix dev server not listening on 127.0.0.1 Vite's default host resolves "localhost" to the IPv6 loopback (::1) on this machine, so it never actually bound 127.0.0.1 -- but that's the exact address Supabase Auth's email confirmation links redirect to (config.toml uses 127.0.0.1 throughout). Binding explicitly to 127.0.0.1 fixes confirmation links without needing to hand-edit them. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_017DUU6CnxECCDeqDNYJgr5x --- vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 52c04f3..f7831dd 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,14 @@ export default defineConfig({ // Pinned (rather than Vite's default floating port) so local Supabase // Auth's redirect allow-list (supabase/config.toml) stays valid instead of // silently breaking if 5173 happens to be busy and Vite picks another one. + // Host is explicit too: Vite's default "localhost" resolves to the IPv6 + // loopback (::1) on this machine, so it never actually listens on + // 127.0.0.1 — but that's exactly the address Supabase Auth's email + // confirmation links redirect to (config.toml uses 127.0.0.1 throughout, + // matching Supabase's own convention). Binding here to 127.0.0.1 instead + // of leaving it to resolve is what makes those links actually work. server: { + host: '127.0.0.1', port: 5173, strictPort: true, },