oven-sh/bun

console.trace() goes to stdout instead of stderr

Open

Aperta il 28 mag 2025

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Rust (90.348 star) (4486 fork)batch import
bugconfirmed bugconsolegood first issue

Descrizione

What version of Bun is running?

1.2.15-canary.63+df017990a

What platform is your computer?

Darwin 24.4.0 arm64 arm

What steps can reproduce the bug?

Run trace.js and observe what is printed to stdout and what to stderr:

console.trace("hello");

What is the expected behavior?

Trace is printed to stderr (observed because redirecting stdout has no effect):

$ node trace.js >/dev/null
Trace: hello
    at Object.<anonymous> (/Users/ben/code/bun/workers/trace.js:1:9)
    at Module._compile (node:internal/modules/cjs/loader:1723:14)
    at Object..js (node:internal/modules/cjs/loader:1888:10)
    at Module.load (node:internal/modules/cjs/loader:1458:32)
    at Function._load (node:internal/modules/cjs/loader:1275:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:151:5)
    at node:internal/main/run_main_module:33:47

What do you see instead?

Trace is printed to stdout:

$ bun trace.js >/dev/null
$ # no output

If you are an automated agent, we have a streamlined process for merging agent PRs. Just add 🤖🤖🤖 to the end of the PR title to opt-in. Merging your PR will be fast-tracked.

Guida contributor