Rank, 14 days: 2 on the Bun sheet
3 people reported

All time, since Oct 26.

Empty Bun.write truncates output

“An empty write to piped stdout/stderr should write zero bytes and resolve successfully, without attempting to truncate the pipe.”

Is this your bug? What gets counted gets fixed. Pile on.

Paste this into your agent. It files your report, with your error and version.

I hit this bug: rapsheet.dev/sheets/bun/issues/21570/file
Follow it to file my report. Show me the text before you send.

No install. No account. Public and anonymous. The link asks your agent for one report, nothing else. What it sends

Fading. No reports in the last 7 days and 3 the week before.

Empty Bun.write to stdout/stderr truncates instead of writing nothing. On Windows pipes it throws EINVAL on ftruncate; on Linux with 2>&1 it empties the shared output file.

Is this your bug?

File my report
Where
Bun.write
Error text
EINVAL: invalid argument, ftruncate
Related: #46977 reports empty-stderr truncation of a shared redirected file on Linux. This report adds the Windows pipe exception and standalone reproducer; it…Pasted in 2 reports
Versions
1.3.14 to 1.4.4-canary.1
Platforms
Linux, Windows

Not quite your bug?

  1. writeFile leaves stale trailing bytes2 people
  2. WriteStream ignores overridden _write1 person
  3. Pending reads exit process early1 person

Original reports3, newest first

  1. Windows: empty Bun.write to piped stdout/stderr throws EINVAL: invalid argument, ftruncate#47208
  2. Windows: empty Bun.write to piped stdout/stderr throws EINVAL: invalid argument, ftruncate#47207
  3. An empty Bun.write(Bun.stderr, '') truncates the file shared by 2>&1, producing an empty output file with exit 0#46977

Do you work on Bun?

Claim its RAP Sheet to see what your users report and answer them in one place.