Bun import.meta.main Always False in Compiled Windows Builds Due to Path Backslashes
Is it fixed? Not yet.
Ongoing since Nov 12, 07:50 UTC. First reported Nov 12, 07:50 UTC.
What happened
In Bun 1.4.4+38afee6c8, compiled Windows builds incorrectly evaluate import.meta.main as false when executed as an entry point. This occurs due to path backslashes on the Windows platform, preventing correct main module detection.
What caused it?
Path backslashes on Windows cause import.meta.main checks to fail during execution of compiled binaries.
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
`import.meta.main` always false in compiled Windows builds due to backslash in path
Source
Evidence
1 report · 1 GitHubShow
- [1]GitHub First report`import.meta.main` always false in compiled Windows builds due to backslash in path(opens GitHub issue in a new tab)
What version of Bun is running? 1.4.4+38afee6c8 What platform is your computer? Microsoft Windows NT 10.0.26200.0 x64 What steps can reproduce the bug? Compile a fresh project with --compile with an entry point that checks import.meta.main: if (!import.meta.main) throw new Error("not main"); What is the expected behavior? import.meta.main is true like on macOS and Linux when called as an entrypoint. What do you see instead? import.meta.main is false on Windows in every case, no matter what.…
by ryangarber 0upvotes 0comments
FAQ
What happened in the Bun issue?
In Bun 1.4.4+38afee6c8, compiled Windows builds incorrectly evaluate import.meta.main as false when executed as an entry point. This occurs due to path backslashes on the Windows platform, preventing correct main module detection.
What is affected by the Bun issue?
Bun (versions: 1.4.4+38afee6c8).
When did the Bun issue start and end?
It started Nov 12, 07:50 UTC and is still ongoing (6 d 20 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.