Bun `bun fmt` Corrupts CSS and Template Literals
Is it fixed? Not yet.
Ongoing since Nov 15, 21:48 UTC. First reported Nov 15, 21:48 UTC.
What happened
Running `bun fmt` on CSS files with unclosed media queries corrupts the file by deleting its remainder, while formatting with `sortTailwindcss` collapses spaces inside template literals passed to functions like `cn()`. Affected users are running Bun versions 1.4.4 and 1.4.5-canary.
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
`bun fmt` with an oxfmt config turns an `@media` with an unclosed `(` into `@media ;` and deletes the rest of the file; oxfmt 0.72 reports a syntax error
Source
Evidence
3 reports · 3 GitHubShow
- [1]GitHub First report`bun fmt` with an oxfmt config turns an `@media` with an unclosed `(` into `@media ;` and deletes the rest of the file; oxfmt 0.72 reports a syntax error(opens GitHub issue in a new tab)
What version of Bun is running? 1.4.4+38afee6c8 (also 1.4.5-canary.1+d4796b2b6) What platform is your computer? Darwin 27.2.0 arm64 arm (same on Linux arm64, oven/bun:1.4.4) What steps can reproduce the bug? mkdir repro && cd repro echo '{}' > .oxfmtrc.json printf '@media (min-width: 640px {\n .a {\n color: red;\n }\n}\n.b {\n color: blue;\n}\n' > a.css bun fmt --check a.css; echo "exit $?" bun fmt a.css; echo "exit $?" cat a.css What is the expected behavior? A syntax error, exit code 2, and…
by ismoiliy98 0upvotes 1comments
- [2]GitHub`bun fmt` with `sortTailwindcss` collapses spaces in a template literal passed to another function inside `cn(...)`, changing the string's value(opens GitHub issue in a new tab)
What version of Bun is running? 1.4.4+38afee6c8 (also 1.4.5-canary.1+d4796b2b6) What platform is your computer? Darwin 27.2.0 arm64 arm (same on Linux arm64, oven/bun:1.4.4) What steps can reproduce the bug? mkdir repro && cd repro echo '{ "private": true }' > package.json bun add tailwindcss@4.3.5 printf '@import "tailwindcss";\n' > app.css printf '[fmt]\n[fmt.sortTailwindcss]\nstylesheet = "./app.css"\n' > bunfig.toml cat > b.ts <<'EOT' declare function cn(...classes: unknown[]): string;…
by ismoiliy98 0upvotes 1comments92% match
- [3]GitHub`bun lint`: an invalid option in bunfig.toml `[lint]` is reported against `.oxlintrc.json`(opens GitHub issue in a new tab)
What version of Bun is running? 1.4.5-canary.1+67d1f55fb What platform is your computer? Darwin 27.3.0 arm64 arm What steps can reproduce the bug? When a rule option in bunfig.toml's [lint] is invalid under an .oxlintrc.json, the error names the .oxlintrc.json as the file at fault, even when that file is {}. Next to an .eslintrc.json, the same option is reported against bunfig.toml. #!/bin/sh set -u BUN="${1:-bun}" cd "$(mktemp -d)" printf 'export const a = 1;\n' > a.ts printf…
by oddharsh 0upvotes 1comments92% match
FAQ
What happened in the Bun issue?
Running `bun fmt` on CSS files with unclosed media queries corrupts the file by deleting its remainder, while formatting with `sortTailwindcss` collapses spaces inside template literals passed to functions like `cn()`. Affected users are running Bun versions 1.4.4 and 1.4.5-canary.
What is affected by the Bun issue?
Bun (versions: 1.4.4+38afee6c8, 1.4.5-canary.1+d4796b2b6).
When did the Bun issue start and end?
It started Nov 15, 21:48 UTC and is still ongoing (3 d 6 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 3 reports from 1 independent source.