Bun

Bun v1.3.3


Jarred Sumner · November 21, 2025

This release fixes 95 issues (addressing 348 👍 reactions)!

To install Bun

curl
npm
powershell
scoop
brew
docker
curl
curl -fsSL https://bun.sh/install | bash
npm
npm install -g bun
powershell
powershell -c "irm bun.sh/install.ps1|iex"
scoop
scoop install bun
brew
brew tap oven-sh/bun
brew install bun
docker
docker pull oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun

To upgrade Bun

bun upgrade

CompressionStream and DecompressionStream

Bun now implements CompressionStream and DecompressionStream. These standard Web APIs allow for streaming compression and decompression of data without buffering the entire payload in memory.

In addition to the standard "gzip", "deflate", and "deflate-raw" formats, Bun also supports "brotli" and "zstd".

const response = await fetch("https://example.com");

// Compress the response body using gzip
const compressed = response.body.pipeThrough(new CompressionStream("gzip"));

// Or use zstd for faster compression
const zstd = response.body.pipeThrough(new CompressionStream("zstd"));

Thanks to @nektro for the contribution!

Control .env and bunfig.toml loading in standalone executables

Standalone executables created with bun build --compile normally look for .env and bunfig.toml files in the directory where the executable is run. You can now disable this behavior at build time using the --no-compile-autoload-dotenv and --no-compile-autoload-bunfig flags.

This is useful when you want to ensure the executable behaves deterministically, regardless of the configuration files present in the user's working directory.

# Disable .env and bunfig.toml loading
bun build --compile --no-compile-autoload-dotenv --no-compile-autoload-bunfig app.ts

You can also configure this via the JavaScript API:

await Bun.build({
  entrypoints: ["./app.ts"],
  compile: {
    // Disable .env loading
    autoloadDotenv: false,

    // Disable bunfig.toml loading
    autoloadBunfig: false,
  },
});

retry and repeats in bun:test

You can now use the retry and repeats options in bun:test. retry runs the callback function up to the specified number of times and if the test passes once then the test passes, while repeats runs the callback function up to the specified number of times and if the test fails once then the test fails. This is useful for handling flaky tests.

import { test } from "bun:test";

test(
  "flaky test",
  () => {
    if (Math.random() > 0.1) throw new Error("fail");
  },
  { retry: 3 },
);

test(
  "check for flakiness",
  () => {
    // run this 20 times to ensure it's stable
  },
  { repeats: 20 },
);

Thanks to @pfgithub for the contribution!

--no-env-file

You can now disable Bun's automatic .env file loading using the --no-env-file flag. This is useful in production environments or CI/CD pipelines where you want to rely solely on system environment variables.

bun run --no-env-file index.ts

This can also be configured in bunfig.toml:

# Disable loading .env files
env = false

Explicitly provided environment files via --env-file will still be loaded even when default loading is disabled.

SQLite 3.51.0

bun:sqlite has been updated to SQLite v3.51.0.

import { Database } from "bun:sqlite";

const db = new Database();
console.log(db.prepare("SELECT sqlite_version()").get());
// { "sqlite_version()": "3.51.0" }

Internal: Upgraded to Zig 0.15.2

Bun is now built with Zig 0.15.2. This reduces the binary size by 0.8MB and improves build times for contributors.

Bundler fixes

  • Fixed: A rare panic in the dev server when processing CSS assets in the incremental graph
  • Fixed: A rare panic in the dev server that could occur when a file referenced by a dynamic import is deleted during a reload

bun install fixes

  • Fixed: A rare crash during bun install involving optional peer dependencies
  • Fixed: A regression in bun install when parsing git dependency URLs with a leading hash
  • Fixed: A regression from Bun v1.3.2 that could cause bun ls --all with unresolved optional peer dependencies to crash
  • Fixed: A regression from Bun v1.3.2 where sharp versions older than v0.33.0 failed to install correctly

Windows fixes

  • Fixed: process.stdout now emits 'resize' events and SIGWINCH signals on Windows, which fixes terminal resizing issues in Claude Code & OpenCode on Windows
  • Improved: bun getcompletes works on Windows
  • Fixed: a crash on Windows when laptop hibernates and then wakes up and resumes execution after a Worker thread had been terminated

Node.js compatibility improvements

  • Implemented: _handle.fd in node:net and node:tls for better compatibility with libraries that rely on the socket file descriptor
  • Fixed: N-API bug preventing rspack or rsbuild from working

Web APIs fixes

  • Fixed: fuzzer-discovered crash when using JSON.stringify on a FormData object in rare cases
  • Fixed: fuzzer-discovered crash when calling stream on a Blob in certain edge cases
  • Fixed: sanitizer-discovered memory leak in Blob

Bun.serve

  • Fixed: An issue where Unicode characters in Bun.serve static Response objects given a string as input were missing the Content-Type header

Networking

  • Fixed: sanitizer-discovered memory leak in node:net.SocketAddress when passing an invalid port
  • Fixed: sanitizer-discovered memory leak in Bun.listen when errors are thrown during socket creation

YAML

  • Fixed: Bun.YAML.stringify would incorrectly serialize strings with leading zeros as numbers
  • Fixed: A performance issue where YAML merge keys could cause parsing to hang due to exponential complexity

Transpiler

  • Fixed: fuzzer-discovered crash in new Bun.Transpiler() with invalid configuration

Bun.spawn

  • Fixed: A small memory leak in Bun.spawn when passing extra non-IPC, non-stdout, non-stderr, and non-stdin file descriptors

TypeScript definitions

  • Fixed: Added JSDoc documentation for configVersion in BunLockFile type definition
  • Fixed: Added missing "css", "jsonc", "yaml", and "html" to the Loader type definition
  • Fixed: Removed unnecessary dependency on @types/react in @types/bun

Security

  • Fixed: Updated root certificates to Mozilla NSS 3.117

bun upgrade fixes

  • Improved: bun upgrade now displays download sizes in human-readable units (e.g. 23.2MiB) instead of raw bytes

Thanks to 19 contributors!