Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/utils/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ export async function startSocketServer(nuxt: Nuxt, options: ModuleOptions, mani

nuxt.hook('close', async () => {
// Close WebSocket server
await websocket?.close()
await listener?.server?.close()
if (websocket) {
await websocket.close()
}
// Close listener server
if (listener) {
await listener.close()
}
})
}

Expand Down Expand Up @@ -211,8 +216,10 @@ export async function watchContents(nuxt: Nuxt, options: ModuleOptions, manifest
}

nuxt.hook('close', async () => {
watcher.close()
db.close()
if (watcher) {
watcher.removeAllListeners()
watcher.close()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you missed db.close()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thank you.

})
}

Expand Down