You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inspector RPC emits EADDRINUSE when middleware-mode Vite servers start concurrently #8
UnoCSS Inspector 66.11.0 emits DF0052 / EADDRINUSE on port 9999 when several Vite middleware-mode servers start concurrently. This occurs with multiple Nuxt dev apps as well. The servers can eventually start because devframe retries on a different port, but startup prints bind-failure diagnostics.
Environment:
macOS, Node 24.18.0
pnpm 12.9.1
Vite 8.3.4
@unocss/vite and @unocss/inspector 66.11.0
devframe 1.2.3
Also observed with Nuxt 4.6.1
Reproduction:
In a fresh standalone folder, use the supplied package.json and repro.mjs.
Run pnpm install and pnpm repro.
Three Vite servers start concurrently with server.middlewareMode: true. Vite's own WebSocket server is disabled via server.ws: false to isolate Inspector's sidecar behavior.
Observe two diagnostics before all three servers finish initialization:
[DF0052] Failed to listen on localhost:9999: listen EADDRINUSE: address already in use ::1:9999
[DF0052] Failed to listen on localhost:9999: listen EADDRINUSE: address already in use ::1:9999
Expected: each Inspector RPC sidecar receives a free port without emitting bind failures.
The middleware fallback in packages-integrations/inspector/src/index.ts currently calls:
When there is no HTTP server, the sidecar's initial port is selected through resolveDevServerPort, whose default preferred port is 9999. Probing and binding are separate operations, so concurrent initializations can select the same port.
A local one-line fix changes the fallback to { ws: { sidecar: true, port: 0 } }, letting the OS allocate the port during bind. The same three-server reproduction completes without DF0052 / EADDRINUSE after that change. The ordinary Vite branch sharing server.httpServer is unchanged.
Related discussion: devframes/devframe#206. That describes atomic allocation for another WebSocket path; this report concerns the Inspector integration's middleware-mode sidecar.
No matching report was found in unocss/unocss when searching for EADDRINUSE, DF0052, and Inspector sidecar on 2026-10-14.
Activity