#836·tsx

tsx crashes with EPIPE when stdout closes early

Author: ghostCreated Aug 30, 2026Updated Aug 30, 2026
Labelsbugpending triage

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://github.com/sophalter/tsx-epipe-repro

Problem & expected behavior (under 200 words)

Running a script through tsx and piping its output to an early-closing reader such as head crashes with an unhandled Error: write EPIPE and exit status 1. This makes ordinary shell pipelines fail even though the script itself is valid. The reproduction pins [email protected]; its GitHub Actions workflow runs a plain Node.js control before demonstrating the failing tsx pipeline.

The equivalent loop run with plain Node.js exits quietly with pipeline statuses 0 0. I expect tsx to match that behavior and terminate cleanly when stdout closes early.

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support