Can be tested with the playground here (node v24.19.0):
nr dev at root (one terminal)
pnpm nuxt dev (in another terminal)
- open / and navigate to /ws, then click ping button
- on playground terminal press q: the process awaits the default timeout (15s) and then logs:
[nitro-runtime] close: 0.054ms
◐ Cleaning up... press Ctrl-C again to exit immediately..
WARN force closing dev worker...
◒ Cleaning up... press Ctrl-C again to exit immediately...function
│
▲ The dev server did not shut down within 15s: 80 file watchers, 1 worker thread, 1 open connection, 2 timers. Exiting anyway.
◇ Canceled
I added a hack to show the opened connections adding the following code before calling summariseActiveResources at setupSignalHandlers in dev.ts:
const handles = (process as any)._getActiveHandles?.()
const networkHandles = handles.filter(h => (
h.constructor.name === 'Socket'
|| h.constructor.name === 'Server'
))
console.dir(networkHandles, { depth: 2 })
const summary = summariseActiveResources()
Moving this.#websocketConnections.add(socket) before the if statement to allow #closeWebSocketConnections to close also these connections, the 1 open connection dissapear.
I'm working on fixing file watchers...
Can be tested with the playground here (node v24.19.0):
nr devat root (one terminal)pnpm nuxt dev(in another terminal)I added a hack to show the opened connections adding the following code before calling
summariseActiveResourcesatsetupSignalHandlersin dev.ts:Moving this.#websocketConnections.add(socket) before the if statement to allow #closeWebSocketConnections to close also these connections, the
1 open connectiondissapear.I'm working on fixing file watchers...