From 963fe062e391e97bb64ae25349b57c8f53fbe3e8 Mon Sep 17 00:00:00 2001 From: vsecoder Date: Wed, 22 Apr 2026 17:16:58 +0300 Subject: [PATCH] fix(desktop): pin Vite + wait-on to IPv4 for Windows dev launch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, `wait-on tcp:5173` can hang forever because Vite's default host ('localhost') binds to IPv6 (::1) while wait-on probes 127.0.0.1. concurrently then never triggers electron:dev, leaving Vite running in the foreground with no Electron window. Pin both sides to IPv4: * `vite --host 127.0.0.1` — force the dev server off ::1. * `wait-on http://127.0.0.1:5173` — real HTTP GET instead of raw TCP, robust against the same dual-stack oddity. * VITE_DEV_SERVER_URL switched to the matching 127.0.0.1 so Electron loads the same origin the CSP checks against. Symptom before: `npm run dev` printed Vite banner then sat there silent. Symptom after: electron:dev line appears within a second, Electron window opens with the Welcome screen. --- desktop/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/package.json b/desktop/package.json index 3d5ea3f..5d45b9a 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -5,8 +5,8 @@ "private": true, "main": "dist-electron/main.js", "scripts": { - "dev": "concurrently -k -n vite,electron -c blue,magenta \"vite\" \"wait-on tcp:5173 && npm run electron:dev\"", - "electron:dev": "npm run build:main && cross-env VITE_DEV_SERVER_URL=http://localhost:5173 electron dist-electron/main.js", + "dev": "concurrently -k -n vite,electron -c blue,magenta \"vite --host 127.0.0.1\" \"wait-on http://127.0.0.1:5173 && npm run electron:dev\"", + "electron:dev": "npm run build:main && cross-env VITE_DEV_SERVER_URL=http://127.0.0.1:5173 electron dist-electron/main.js", "build": "npm run build:main && vite build && electron-builder", "build:renderer": "vite build", "build:main": "tsc -p electron/tsconfig.json",