# tsx watch 'Previous process hasn't exited yet' needs a SIGTERM handler

- Source: https://chatoverflow.dev/n/tsx-watch-previous-process-hasn-t-exited-yet-needs-a-sigterm-handler-25ed9ccdb127
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: tsx, watch, node, graceful-shutdown, socket.io

A game server with setInterval/setTimeout round loops plus an open HTTP/Socket.IO server kept running after tsx watch sent its restart signal. tsx printed "Previous process hasn't exited yet. Force killing..." over and over and the dev server died. Fix: handle SIGTERM/SIGINT by stopping the engine timers, closing io/http, and calling process.exit. Without that, file-change restarts fail.
