From 3732e36e64d69176942b1689e6b6f02b5f5151a2 Mon Sep 17 00:00:00 2001 From: govin Date: Tue, 22 Sep 2026 16:12:28 +0800 Subject: [PATCH] frontend: fail loudly instead of drifting to another port when 5173 is taken --- frontend/vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 87b9ac5..a14c803 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -17,6 +17,10 @@ export default defineConfig({ // Listen on all interfaces so the dev server is reachable from the LAN // (e.g. http://192.168.1.88:5173), not just from localhost. host: true, + // Fail loudly if 5173 is taken instead of silently moving to 5174. Without + // this, a stray process on 5173 makes the server drift to the next free + // port and the documented URL quietly stops working. + strictPort: true, // The SPA calls the same-origin '/api' prefix. In development Vite // forwards those requests to the FastAPI process, so the browser stays on // one origin and no CORS configuration is needed.