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
When using the programmatic SSR API of a ViteDevServer instance in another server, attempting to dispose of the instance via the close method will throw when the http server has not been started.
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
at Server.close (net.js:1606:12)
at Object.onceWrapper (events.js:421:28)
at Server.emit (events.js:315:20)
at emitCloseNT (net.js:1659:8)
at processTicksAndRejections (internal/process/task_queues.js:79:21)
Describe the bug
When using the programmatic SSR API of a
ViteDevServer
instance in another server, attempting to dispose of the instance via theclose
method will throw when the http server has not been started.Reproduction
Will throw an uncaught exception:
via
vite/packages/vite/src/node/server/index.ts
Lines 315 to 320 in b2110af
Perhaps an easy fix would be to add an additional condition on
|| !server.listening
here:vite/packages/vite/src/node/server/index.ts
Line 583 in b2110af
System Info
vite
version:2.0.0-beta.62
v14.15.4
6.14.10
Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag. N/AThe text was updated successfully, but these errors were encountered: