Bun Bundler: Shebang '#!/usr/bin/env bun' Overrides Explicit '--target node'
Is it fixed? Not yet.
Ongoing since Nov 13, 06:44 UTC. First reported Nov 13, 06:44 UTC.
What happened
When bundling with Bun, an entry file containing a '#!/usr/bin/env bun' shebang overrides the explicit '--target node' parameter, resulting in an incorrect bundle target. The issue affects developers utilizing Bun's bundler with Node.js targets on entry points that include a shebang.
What caused it?
Under active investigation. No report has identified a root cause yet.
No verified workaround yet
None of the linked reports describe a mitigation. This page updates when one appears.
Official fixTimeline
- Investigating(current)
- Workaround available(upcoming)
- Resolved(upcoming)
- First report on GitHub issue
bundler: a `#!/usr/bin/env bun` entry overrides an explicit `--target node`
Source
Evidence
1 report · 1 GitHubShow
- [1]GitHub First reportbundler: a `#!/usr/bin/env bun` entry overrides an explicit `--target node`(opens GitHub issue in a new tab)
What version of Bun is running? 1.4.4+38afee6c8 What platform is your computer? Linux 6.18.36 x86_64 (the source path below is not platform-specific) What steps can reproduce the bug? printf '#!/usr/bin/env bun\nif (import.meta.main) console.log("main");\n' > a.ts bun build --target node --format esm --outfile out.js a.ts cat out.js node out.js Bun.build({ entrypoints: ["./a.ts"], target: "node", format: "esm" }) gives the same output. What is the expected behavior? A Node bundle, the same as…
by chenxin-yan 0upvotes 0comments
FAQ
What happened in the Bun issue?
When bundling with Bun, an entry file containing a '#!/usr/bin/env bun' shebang overrides the explicit '--target node' parameter, resulting in an incorrect bundle target. The issue affects developers utilizing Bun's bundler with Node.js targets on entry points that include a shebang.
What is affected by the Bun issue?
Bun (versions: 1.4.4+38afee6c8).
When did the Bun issue start and end?
It started Nov 13, 06:44 UTC and is still ongoing (5 d 21 h so far). This page updates as it develops.
How do I get alerts for Bun?
Subscribe to the Bun RSS feed for every new Bun incident, or connect an AI assistant to WhatBrokeToday over MCP and ask whether Bun is down. Bun feed
Where does this information come from?
WhatBrokeToday collects public status pages, developer community reports and security advisories, groups the ones about the same problem, and links every report under Evidence on this page. This one has 1 report from 1 independent source.