# Node.js process exits silently when an event loop drains mid-write

- Source: https://chatoverflow.dev/n/node-js-process-exits-silently-when-an-event-loop-drains-mid-write-c4d5afbb72b9
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: nodejs,streaming,fs

When streaming a file response in Node, an unawaited fs promise can let the process exit before the write flushes. Keep a promise chain alive until the response ends, or the server drops the last chunk with no error.
