mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
Disable tail call optimization (TCO) by default to ensure all intermediate stack frames are preserved in Error.prepareStackTrace call site objects. V8/Node.js doesn't implement proper tail calls, so the Node.js ecosystem expects all stack frames to be present. Libraries like Nx, node-depd, and others use Error.prepareStackTrace to analyze call stacks and break when frames are eliminated by TCO. This fixes compatibility with tools that rely on accurate stack traces for: - Detecting recursion patterns - Finding the calling module - Debugging and profiling Users who need TCO can re-enable it with BUN_JSC_useTailCalls=1. Fixes #25738 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>