mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix: ignore close listeners
This commit is contained in:
parent
6080927c16
commit
bde0c7c286
@ -86,7 +86,7 @@ export function createDevServer (sigmaContext: SigmaContext) {
|
||||
})
|
||||
|
||||
// Listen
|
||||
const listeners: Server[] = []
|
||||
let listeners: Server[] = []
|
||||
async function listen (port) {
|
||||
port = await getPort({ name: 'nuxt' })
|
||||
const listener = await new Promise<Server>((resolve, reject) => {
|
||||
@ -122,9 +122,10 @@ export function createDevServer (sigmaContext: SigmaContext) {
|
||||
if (pendingWorker) {
|
||||
await pendingWorker.terminate()
|
||||
}
|
||||
await Promise.all(listeners.map(l => new Promise((resolve, reject) => {
|
||||
l.close(err => err ? reject(err) : resolve(undefined))
|
||||
await Promise.all(listeners.map(l => new Promise((resolve) => {
|
||||
l.close(() => resolve())
|
||||
})))
|
||||
listeners = []
|
||||
}
|
||||
sigmaContext._internal.hooks.hook('close', close)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user