fix(desktop): auto-bump dev port when 5173 is occupied#1698
Open
Myestery wants to merge 2 commits intodifferent-ai:devfrom
Open
fix(desktop): auto-bump dev port when 5173 is occupied#1698Myestery wants to merge 2 commits intodifferent-ai:devfrom
Myestery wants to merge 2 commits intodifferent-ai:devfrom
Conversation
electron-dev.mjs hardcoded port 5173 with strictPort: true and treated "port is open" as "Vite is ready", so a stranger process on 5173 caused Electron to load whatever it served (or Vite to crash on spawn). - Probe IPv4 + IPv6 localhost via existing probeHost to detect actual occupancy (not just IPv4 listen-bindability). - If default port busy, scan upward (5173-5272) for first free port and rebuild startUrl + viteProbeUrls. Honor explicit PORT= by failing loud instead of silently bumping. - Drop the "port-open == Vite-ready" fallback that masked collisions. - Tighten fetchWithTimeout default 4000ms -> 1500ms; the 4s timeout caused 12s probe hangs against non-HTTP TCP listeners.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@Myestery is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1697
Summary
probeHost); the previous listen-only check missed Vite's[::1]-only binding.startUrl+viteProbeUrls, log the bump.PORT=override by failing fast instead of silently re-assigning.portIsOpenForVite"port-open == Vite-ready" fallback that caused Electron to load stranger processes serving on 5173.fetchWithTimeoutdefault 4000ms → 1500ms; the 4s timeout caused ~12s probe hangs against non-HTTP TCP listeners on the bumped path.apps/app/vite.config.tsis unchanged —strictPort: truestays correct now that the launcher guarantees a free port.Test plan
pnpm devwith 5173 free → Vite + Electron come up on 5173.python3 -m http.server 5173(or raw TCP listener) in another shell, thenpnpm dev→ log showsPort 5173 busy — using 5174 instead, Electron loads the openwork app at 5174 (not the stranger).PORT=5173 pnpm devwith 5173 busy → fails fast with a clear error.PORT=6001 pnpm devwith 6001 free → Vite + Electron come up on 6001.