Bun 1.4, released on August 20, 2026, is the first Bun release written in Rust instead of Zig, and it reports Node.js 26 compatibility. For most applications the upgrade is uneventful, but Bun 1.4 ships around 40 documented behavior changes, and a handful of them (YAML parsing, strict bunfig.toml, .env loading under bun --bun, jest.resetAllMocks(), and TLS hostname checks) break real projects silently rather than loudly. The current release is Bun 1.4.5 (November 19, 2026), a security release you should be on regardless.

This guide covers what changed for users (not for Bun's maintainers), the breaking changes ranked by how likely they are to bite, a grep-based audit script you can run before upgrading, and a rollout plan with a tested rollback path. Everything is sourced from the Bun 1.4 release notes and the patch release posts. I did not have a Bun binary available in this environment, so the audit script was tested with plain grep on a sample tree, and the Bun behaviors described here come from the official notes rather than my own runs.

Bun 1.4 release timeline

Version Date What it is
1.3.14 May 13, 2026 Last Zig-based release
1.4.0 August 20, 2026 Rust rewrite, Node.js 26 compatibility, all behavior changes below
1.4.1 September 4, 2026 Fixes 202 issues; HTTP/2 in Bun.serve, bun install --offline
1.4.2 September 5, 2026 Regression fixes, including an AsyncLocalStorage memory leak and a bun build name collision
1.4.3 October 10, 2026 Adds bun check, a built-in TypeScript type checker
1.4.4 October 22, 2026 Adds bun fmt, a Prettier-compatible formatter; Yarn Berry lockfile migration
1.4.5 November 19, 2026 Security release: updates lsquic, c-ares, SQLite, llhttp, BoringSSL

Release dates are from the oven-sh/bun GitHub releases. The 1.4.2 entry is worth noticing: it shipped one day after 1.4.1 to fix regressions, which is a reminder that a rewrite of this size produces follow-up fixes for a while. If you are upgrading now, go straight to 1.4.5.

What actually changed for users in Bun 1.4

The Rust rewrite

Jarred Sumner's Rewriting Bun in Rust post explains the motivation: a steady stream of use-after-free crashes and memory leaks from mixing JavaScriptCore's garbage collector with manually managed Zig memory. Bun 1.3.14 was the last Zig version. The port was done largely with Claude (the post discloses that Anthropic acquired Bun in December 2025), with the stated rule that the Rust code should initially mirror the Zig architecture rather than be redesigned. The JavaScript engine is still JavaScriptCore, so JS semantics did not change because of the rewrite.

What this means in practice: your code does not need to change because Bun is written in Rust. The post is candid that the rewrite introduced 19 known regressions, all fixed before release. The behavior changes you need to care about are deliberate compatibility and spec-alignment fixes that happened to ship in the same release.

Vendor-reported performance numbers

The release notes claim 5x lower idle CPU for a hello-world server, up to 35% lower memory, and 50% faster startup on Linux. For Claude Code specifically, they report production CPU dropping from a p99 of 24% to 10%. These are vendor-reported numbers on Bun's own workloads. Measure your own service before and after, using the same load test and the same container limits, before you quote them internally.

New built-ins worth knowing about

Bun 1.4 adds Bun.Image, Bun.WebView (headless browser automation), Bun.markdown, Bun.cron(), Bun.Terminal, bun run --parallel, bun test --parallel, bun audit fix, bun dedupe, and bun prune. The 1.4.x patch line then added two tools that matter more to teams than most of those APIs: bun check in 1.4.3 and bun fmt in 1.4.4. None of these are required for the upgrade, so add them after you have stabilized on 1.4.

Bun 1.4 breaking changes ranked by how often they bite

The release notes list "five changes most likely to need a line in your project." From experience with runtime upgrades, I would rank the full list slightly differently, by how quietly each one fails:

Change Since How it fails Fix
Bun.YAML follows YAML 1.2: yes/no/on/off are strings 1.3.5 Silently: config flags become truthy strings Use true/false in YAML files
Bun invoked as node (bun --bun, bunx --bun) no longer loads .env 1.4.0 Silently: env vars are undefined node --env-file=.env script.js
jest.resetAllMocks() drops mock implementations 1.4.0 Tests fail with undefined returns Use clearAllMocks() if you only want call history reset
tls.connect uses host as the default servername 1.3.13 ERR_TLS_CERT_ALTNAME_INVALID connecting by IP Pass servername explicitly
bunfig.toml and Bun.TOML are strict 1.4.0 Startup error: TOML Parse error: Strings must be quoted Quote values
process.versions.modules is 147 (Node.js 26) 1.4.0 Native addon fails to load Install a prebuild for ABI 147 or build from source
Request/Response clone() throws after the body is read 1.4.0 TypeError: Body is disturbed or locked Clone before reading
Bun.cron() and Bun.cron.parse() use local time 1.4.0 Jobs fire at the wrong hour on non-UTC hosts Pass { tz: "UTC" }
"jsx": "react-jsx" emits production jsx() 1.4.0 Lost dev-only warnings Use "react-jsxdev" for development
import "." resolves to the directory index 1.4.0 Wrong module loaded Name the sibling file explicitly

YAML and .env: the silent ones

The YAML change is the one I would check first, because nothing throws. The notes give the canonical example: an on: key in a GitHub Actions workflow now parses as the string "on", not true. More dangerous is a config file with enabled: yes, which now yields the string "yes". If your code does if (config.enabled), both "yes" and "no" are truthy, so a feature you thought was disabled turns on:

Bun.YAML.parse("cache: no");
// Bun 1.3.x (before 1.3.5): { cache: false }
// Bun 1.4:                  { cache: "no" }  -> truthy

The .env change affects projects that run bun --bun run <script> where the script itself calls node. Bun now behaves like Node and does not auto-load .env in that mode. bun file.js still loads it. The fix from the notes:

{
  "scripts": {
    "check": "node --env-file=.env ./check.js"
  }
}

Test-suite changes

Two bun:test changes will turn green suites red. jest.resetAllMocks() (and vi.resetAllMocks()) now matches Jest and resets implementations, so a jest.fn(() => 42) returns undefined after the reset. And toContain() now compares with === instead of Object.is, so expect([NaN]).toContain(NaN) fails and expect([-0]).toContain(0) passes. Both are correct per Jest; they only hurt if your tests relied on the old behavior.

TLS and native addons

The tls.connect change landed in 1.3.13, so you may already have hit it. If your Postgres or Redis driver connects by IP address or localhost to a server whose certificate names a hostname, the connection now fails with ERR_TLS_CERT_ALTNAME_INVALID, matching Node.js. That applies to drivers like pg and ioredis that call tls.connect() for you. Pass the certificate's hostname as servername, or connect by that hostname.

Native addons are the other hard failure. Bun 1.4 reports Node.js 26, so process.versions.modules is 147. Packages that select a prebuilt .node binary by ABI version need a build for 147; if the maintainer has not published one, the install falls back to compiling from source (needs a toolchain) or fails. The same ABI change hits Node.js 26 users, which we covered in the Node.js 26 LTS upgrade guide.

Package manager and lockfile changes

New lockfiles are written as lockfileVersion: 2, which adds integrity checks for tarballs outside your registry and validates git dependency paths. Existing v0/v1 lockfiles keep loading, and the notes say to run bun install to migrate. My inference, not something the notes state outright: once a v2 lockfile is committed, teammates and CI runners still on 1.3.x are likely to fail to read it, so upgrade every environment together.

New monorepos default to the isolated linker; existing lockfiles keep hoisted. bun update now also moves transitive packages, and a project's bunfig.toml now overrides .npmrc for the same key. If you compare package managers, our pnpm vs npm vs Yarn vs Bun breakdown covers the linker models in detail.

Run a compatibility audit before you upgrade

Most of the breaking changes leave a fingerprint you can grep for. This script lists every hit so you can review each one. It is deliberately noisy (for example, every .clone() call is flagged); a hit means "look at this," not "this is broken":

#!/usr/bin/env bash
# bun14-audit.sh: flag code patterns affected by Bun 1.4 behavior changes.
set -u
check() {
  local label="$1" pattern="$2"
  local hits
  hits=$(grep -rnE "$pattern" --include='*.ts' --include='*.tsx' --include='*.js' \
    --include='*.mjs' --include='*.cjs' --include='*.json' --include='*.toml' \
    --exclude-dir=node_modules --exclude-dir=dist . 2>/dev/null)
  [ -n "$hits" ] && printf '\n## %s\n%s\n' "$label" "$hits"
}
check "res.writeHeader removed (use writeHead)"        'writeHeader\('
check "resetAllMocks now drops implementations"        'resetAllMocks\('
check "fs.rmdir recursive now throws (use fs.rm)"      'rmdir\([^)]*recursive'
check "Bun.YAML: yes/no/on/off are strings"            'Bun\.YAML|\.ya?ml["'"'"']'
check "setKeepAlive delay is now milliseconds"         'setKeepAlive\('
check "Bun.cron uses local time, not UTC"              'Bun\.cron'
check "clone() throws after body is read"              '\.clone\(\)'
check "toContain uses === (NaN no longer matches)"     'toContain\(NaN'
check "Bun.mmap offset no longer page-aligned"         'Bun\.mmap\('
check "import \".\" now resolves to the directory"     'from ["'"'"']\.\.?["'"'"']'
check ".css default import is {} at runtime"           'import [A-Za-z_$]+ from ["'"'"'][^"'"'"']+\.css["'"'"']'
check "tls host is now the default servername"         'tls\.connect\('
check "jsx react-jsx now emits production jsx()"       '"jsx": *"react-jsx"'
check "useDefineForClassFields:false now honored"      'useDefineForClassFields'
check "bunfig.toml values must be quoted"              '^[a-zA-Z_]+ *= *[a-zA-Z]'

On a sample tree seeded with one example of each pattern, the output looks like this (trimmed):

## res.writeHeader removed (use writeHead)
./src/sample.ts:3:res.writeHeader(200, {});

## resetAllMocks now drops implementations
./src/sample.ts:4:afterEach(() => jest.resetAllMocks());

## tls host is now the default servername
./src/sample.ts:12:tls.connect({ host: "10.0.0.12", port: 5432 });

## bunfig.toml values must be quoted
./bunfig.toml:2:linker = isolated

The last check also flags unquoted booleans like frozenLockfile = true, which are valid TOML; ignore those. Things grep cannot find: YAML files whose values are yes/no (grep your .yml files for : *(yes|no|on|off)$), native addons (run npm ls and look for packages with .node binaries or node-gyp), and scripts that rely on .env under bun --bun.

How to upgrade to Bun 1.4 safely

1. Upgrade one environment, pinned

Install a specific version rather than "latest," so every machine runs the same build. The installation docs support passing a tag to the install script:

curl -fsSL https://bun.com/install | bash -s "bun-v1.4.5"
bun --version     # 1.4.5
bun --revision    # exact commit, useful in bug reports

On Windows, use iex "& {$(irm https://bun.com/install.ps1)} -Version 1.4.5". In CI, pin the same version in your setup step (for GitHub Actions, the bun-version input of oven-sh/setup-bun) and in Docker use an explicit tag such as oven/bun:1.4.5 rather than latest.

2. Fix the loud failures, then hunt the quiet ones

Run bun install, your build, and bun test. Loud failures (TOML parse errors, native addon load errors, failing mocks) show up immediately. Then work through the audit script output and your YAML files for the quiet ones. If you use TypeScript, 1.4.3+ gives you bun check as a fast type-check pass; it does not replace tsc in CI until you have confirmed it reports the same errors on your codebase. Bun says its templates are ready for TypeScript 7; if you are also moving compilers, see our TypeScript 7 migration guide.

3. Commit the lockfile change in its own pull request

Running bun install on 1.4 can rewrite bun.lock. Put that diff in a dedicated PR with the CI and Docker version bumps, so reviewers can see that nothing else changed and so a revert is one click.

4. Canary in production

Deploy 1.4.5 to one instance or a small traffic slice. Watch memory, CPU, error rates, and TLS errors from database and cache clients for at least a full business cycle. Pay attention to graceful shutdown: server.stop() now waits for in-flight requests and closes idle keep-alive connections, which changes how long deploys take to drain.

5. Keep a tested rollback

Rolling back is the same install command with the older tag, plus the old lockfile from git:

curl -fsSL https://bun.com/install | bash -s "bun-v1.3.14"
git checkout main~1 -- bun.lock   # or revert the lockfile PR
bun install --frozen-lockfile

Test this once on a staging box before you need it, especially if the 1.4 lockfile has already been committed.

6. Stay current on 1.4.x

Bun 1.4.5 updates BoringSSL, lsquic, c-ares, SQLite, and llhttp, and the notes say the affected surface includes HTTP/3, HTTP/1.1, TLS, DNS, fetch, Bun.serve, node:http, node:https, node:tls, and node:dns. No CVE identifiers are listed in the post, so you cannot easily assess exposure; assume an internet-facing server is affected and upgrade. While you are tightening the supply chain, note that the 1.3 to 1.4 line also narrowed trustedDependencies (since 1.3.5): Bun's default trusted list now only applies to packages from the npm registry, so a git: or file: dependency named like a trusted package no longer gets to run lifecycle scripts. Our guide to npm trusted publishing covers the publishing side of the same problem.

Frequently Asked Questions

Is Bun 1.4 stable enough for production?

Bun says 100% of its own test suite passed on all platforms before the Rust version merged, and the 1.4.x line has had five patch releases since August 2026. That is a reasonable signal, but run your own canary. Go straight to 1.4.5 rather than 1.4.0.

Do I need to change my code because Bun is now written in Rust?

No. The JavaScript engine is still JavaScriptCore, and the rewrite itself is not meant to change behavior. What you may need to change is caused by the deliberate behavior fixes in 1.4, such as YAML 1.2 parsing, strict TOML, and Node.js 26 alignment.

Why does my bunfig.toml fail after upgrading to Bun 1.4?

The rewritten TOML parser is strict. Unquoted string values, missing newlines between key/value pairs, and integers beyond Number.MAX_SAFE_INTEGER now throw SyntaxError, and Bun fails at startup with TOML Parse error: Strings must be quoted. Quote the value, for example linker = "isolated".

How do I downgrade from Bun 1.4 to 1.3?

Re-run the installer with the older tag: curl -fsSL https://bun.com/install | bash -s "bun-v1.3.14". Restore the previous bun.lock from git and run bun install --frozen-lockfile, because the 1.4 lockfile format may not be readable by older versions.

Does Bun 1.4 support Node.js 26 APIs?

Bun 1.4 reports Node.js 26 compatibility, targeting Node.js 26.3.0, and added 1,517 newly passing tests from Node's own suite. Bun also says it is not 100% Node-compatible yet, so check its per-module compatibility status for any APIs you rely on.

What is the latest Bun version?

As of December 2, 2026, the latest release is Bun 1.4.5 from November 19, 2026, a security release. Check the releases page before pinning, since patch releases are frequent.

Conclusion

Bun 1.4's headline is the Rust rewrite, but the work for users is in the behavior changes. Audit for the silent ones first: YAML booleans, .env loading under bun --bun, resetAllMocks(), and TLS server names. Pin 1.4.5 everywhere at once, commit the lockfile change separately, canary it, and keep the 1.3.14 rollback command tested. Most teams will find the upgrade takes an afternoon; the ones that get hurt are the ones that upgraded a laptop and a CI image on different days.