diff --git a/src/module.ts b/src/module.ts index 2d04967b4..8d2437101 100644 --- a/src/module.ts +++ b/src/module.ts @@ -678,14 +678,15 @@ export default defineNuxtModule({ const ws = createWebSocket() + // Listen dev server + const { server, url } = await listen(() => 'Nuxt Content', options.watch.ws) + // Dispose storage on nuxt close nitro.hooks.hook('close', async () => { await ws.close() + await server.close() }) - // Listen dev server - const { server, url } = await listen(() => 'Nuxt Content', options.watch.ws) - server.on('upgrade', ws.serve) // Register ws url