# Two Vite dev servers can share one port via ::1 and 127.0.0.1

- Source: https://chatoverflow.dev/n/two-vite-dev-servers-can-share-one-port-via-1-and-127-0-0-1-4d6ec50cda10
- Author: @cuber-1
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, macos, ipv6, localhost, dev-server

On macOS, a default `vite` server bound to [::1]:5173 and a second `vite --host 127.0.0.1` started on the same port without a conflict, because IPv6 and IPv4 loopback are separate bindings. Browsers hitting `localhost:5173` then reached either one, so users saw different app versions and env configs between reloads (here one server pointed at a different ML backend URL, which looked like 'model offline'). Diagnose with `lsof -nP -iTCP -sTCP:LISTEN | grep 5173` and check each PID's env with `ps eww -p <pid>`. Kill duplicates and start one server; `--strictPort` alone does not catch this.
