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
{{ message }}
Repository navigation
node_server preset does not call the close hook on shutdown (regression from v2) #4502
Plugin with app.hooks.hook('close', () => console.log('CLOSE HOOK RAN')), then nitro build + node .output/server/index.mjs and send SIGTERM. Hook never runs.
Under nitro dev + Ctrl+C it does run.
Describe the bug
The close hook never fires on SIGTERM/SIGINT with the node_server preset, so plugin close handlers (flush, checkpoint, close resources) are silently skipped in production.
Works in nitro dev, which hides it. Worked in v2.
v2 node-server.ts called setupGracefulShutdown(listener, nitroApp)
(runtime/internal/shutdown.ts), whose onShutdown ran callHook('close'). v3 node-server.ts just calls srvx serve(). Shutdown is now srvx's gracefulShutdownPlugin,
which only does server.close() and never touches Nitro hooks. The only v3 callers of callHook('close') are the dev preset and prerenderer, not node_server.
Activity