From 62e8721e7f8af3e856197f0f26f784a9726b7369 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Wed, 5 Aug 2026 23:35:47 -0700 Subject: [PATCH] [eric] dev: run.sh preflight also clears a stale :3000 so the frontend can't die on EADDRINUSE --- run.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/run.sh b/run.sh index 987afa4e..d9fb9bd9 100755 --- a/run.sh +++ b/run.sh @@ -105,6 +105,14 @@ if lsof -ti :$BACKEND_PORT >/dev/null 2>&1; then sleep 0.3 fi +# Same guard for webpack's port: a stray dev server (or a test harness) holding :3000 made the +# frontend die with EADDRINUSE and took the whole run down. +if lsof -ti :3000 >/dev/null 2>&1; then + echo -e "${YELLOW}${BOLD}[preflight]${RESET} Port 3000 still bound from a prior run, killing stale process..." + lsof -ti :3000 | xargs kill -9 2>/dev/null || true + sleep 0.3 +fi + # --- Start backend --- # Mark this as a dev launch so backend/run.sh enables --reload. Packaged # builds never run this top-level script (Electron spawns backend