diff --git a/packages/vike-node/src/runtime/adapters/createServerResponse.ts b/packages/vike-node/src/runtime/adapters/createServerResponse.ts index 6235b5c..94e8c72 100644 --- a/packages/vike-node/src/runtime/adapters/createServerResponse.ts +++ b/packages/vike-node/src/runtime/adapters/createServerResponse.ts @@ -32,10 +32,12 @@ function createServerResponse(incomingMessage: IncomingMessage) { } ) - res.once('finish', () => { - passThrough.end() + passThrough.once('finish', () => { + res.emit('finish') + }) + passThrough.once('close', () => { + res.emit('close') }) - passThrough.on('drain', () => { res.emit('drain') })