---
title: Bun v1.1.35
description: "Fixes 46 bugs (addressing 570 👍). Musl LibC support, JUnit XML test output, 6 MB binary size reduction, `Worker` `preload` option, faster `fs.readFile` for small files, deep equality support for `Headers` and `URLSearchParams`, `node:net` compatibility improvements, unicode import bugfixes, several `bun install` fixes"
date: "2024-11-19T10:54:31.123Z"
author: dylan
---

{% callout %}
We're hiring [systems engineers](/careers) in San Francisco to build the future of JavaScript!
{% /callout %}

This release fixes 46 bugs (addressing 570 👍). It introduces Musl LibC support, JUnit XML test output, 6 MB binary size reduction, `Worker` `preload` option, faster `fs.readFile` for small files, deep equality support for `Headers` and `URLSearchParams`, `node:net` compatibility improvements, unicode import bugfixes, and several `bun install` fixes.

#### To install Bun

{% codetabs %}

```sh#curl
$ curl -fsSL https://bun.sh/install | bash
```

```sh#npm
$ npm install -g bun
```

```sh#powershell
$ powershell -c "irm bun.sh/install.ps1|iex"
```

```sh#scoop
$ scoop install bun
```

```sh#brew
$ brew tap oven-sh/bun
$ brew install bun
```

```sh#docker
$ docker pull oven/bun
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
```

{% /codetabs %}

#### To upgrade Bun

```sh
$ bun upgrade
```

### Native support for Musl & Alpine Linux

Bun v1.1.35 ships binaries with native support for [Musl LibC](https://musl.libc.org) and is now tested on every commit. This was our #1 rated outstanding feature request with over 281 :+1:. If you are running on Alpine Linux the Bun install script will now download these binaries.

This change additionally affects any use of the Docker image `oven/bun:alpine`. Previously, we relied on a glibc compatibility hack to run Bun on Alpine Linux - and now it's native.

Thanks to [@nektro](https://github.com/nektro) and [@Electroid](https://github.com/Electroid)!

### Bun gets 6 MB smaller

We've reduced the size of the Bun binary by 3.5 MB on Windows, and by 6 MB on Linux and macOS. This was achieved by allocating large structs on the heap instead of the stack, and by removing unwind tables created by our dependencies.

### JUnit XML output support for `bun test`

Bun v1.1.35 adds support for JUnit output in `bun test`. It can be enabled through the command line with `--reporter` or through `bunfig.toml`.

To enable the JUnit reporter and write the output to `junit.xml`:

```sh
$ bun test --reporter junit --reporter-outfile junit.xml
```

Or in `bunfig.toml`:

```toml#bunfig.toml
[test.reporter]
junit = "junit.xml"
```

JUnit is a commonly used XML format for CI/CD test integration with Jenkins, CircleCI, GitLab CI, and more.

{% raw %}

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">In the next version of Bun<br><br>bun test supports reporting test results in the junit xml format, which is used in CI/Cd like GitLab <a href="https://t.co/MbP8Q5HQxk">pic.twitter.com/MbP8Q5HQxk</a></p>&mdash; Bun (@bunjavascript) <a href="https://twitter.com/bunjavascript/status/1858816473751580912?ref_src=twsrc%5Etfw">November 19, 2024</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

{% /raw %}

### `preload` option for `Worker`

Bun v1.1.35 introduces a `preload` option for `Worker`, which allows you to evaluate a script before the worker script is executed.

```js#preload.js
globalThis.preloaded = true;
```

```js#index.js
const worker = new Worker(new URL("worker.js", import.meta.url).href, {
    preload: new URL("preload.js", import.meta.url).href
});
```

```js#worker.js
console.log(globalThis.preloaded); // true
```

### data URI `import` support

Bun v1.1.35 adds support for importing data URIs as modules.

```ts#index.ts
import data from "data:text/javascript,export default 'bun!';"
console.log(data) // bun!
```

Thanks to [@yamalight](https://github.com/yamalight)!

### `console.group` and `console.groupEnd`

Bun v1.1.35 also adds support for `console.group` and `console.groupEnd`.

```js#index.js
console.group("begin");
console.log("indent!");
console.groupEnd();
// begin
//   indent!
```

### `${configDir}` support in `tsconfig.json`

Bun v1.1.35 adds support for `${configDir}` in `tsconfig.json` files. This makes relative paths from extended `tsconfig.json` files more useful, as they can be relative to the directory containing the derived `tsconfig.json`.

```json#tsconfig.json
{
    "extends": "../tsconfig.base.json"
}
```

```json#tsconfig.base.json
{
    "compilerOptions": {
        "outDir": "${configDir}/dist"
    }
}
```

### `fs.readFile` gets up to 10% faster for small files

We've micro-optimized `fs.readFile` for small files, making it up to 10% faster.

{% raw %}

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">In the next version of Bun<br><br>fs.readFile gets up to 10% faster at reading small files (reminder: 1 µs == 1000ns) <a href="https://t.co/3vgg8FRfMs">pic.twitter.com/3vgg8FRfMs</a></p>&mdash; Jarred Sumner (@jarredsumner) <a href="https://twitter.com/jarredsumner/status/1855427363133333870?ref_src=twsrc%5Etfw">November 10, 2024</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

{% /raw %}

### `[eval with bun]` VSCode codelens action

{% raw %}

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">In the next version of Bun&#39;s VSCode extension<br><br>Untitled JavaScript &amp; TypeScript files have an &quot;eval with bun&quot; codelens action (only on scratch files) <a href="https://t.co/iv9L6444wv">pic.twitter.com/iv9L6444wv</a></p>&mdash; Jarred Sumner (@jarredsumner) <a href="https://twitter.com/jarredsumner/status/1853394062629540275?ref_src=twsrc%5Etfw">November 4, 2024</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

{% /raw %}

### `Headers` and `URLSearchParams` support in `expect().toEqual()`

Deep equals support for `Headers` and `URLSearchParams` has been added in Bun v1.1.35. This allows you to compare entries in `Headers` and `URLSearchParams` objects in `expect().toEqual()`, `Bun.deepEquals()`, and other deep equality checks.

Each of the following tests would previously fail.

```js#index.test.js
test("Headers", () => {
    const headers1 = new Headers([["a", "b"]]);
    const headers2 = new Headers([["a", "c"]]);
    expect(headers1).not.toEqual(headers2);
});
test("URLSearchParams", () => {
    const params1 = new URLSearchParams("a=b");
    const params2 = new URLSearchParams("a=c");
    expect(params1).not.toEqual(params2);
});
```

## Node compatibility improvements

### `node:net` compatibility improvements for `net.Server`, `net.Socket`, and event emitting bugs

We've fixed many compatibility issues with `node:net` in this release. Most notably, the `net.Server` class is now fully implemented, and `Socket.setKeepAlive` and `Socket.setNoDelay` are implemented.

Thanks to [@cirospaciari](https://github.com/cirospaciari)!

### Fixed: `node:zlib` class prototypes and function names

The classes in `node:zlib` were missing `Object.setPrototypeOf`, which would cause subtle issues when the classes are subclassed. This was been fixed, along with more tests for `name` properties from `node:zlib`.

### Fixed: Resulting signal codes from `child_process.spawnSync`

The `signal` property of the result from `child_process.spawnSync` was not being set correctly. The following code would print `null` instead of `SIGTRAP`.

```js#index.js
import { spawnSync } from 'child_process';
console.log(spawnSync(process.argv0, ['-e', 'process.kill(process.pid, "SIGTRAP")']).signal);
// Before:      null
// Bun v1.1.35: SIGTRAP
```

Fixed thanks to [@ippsav](https://github.com/ippsav)!

### Fixed: `node:https` `Agent` prototype chain regression

A regression causing the prototype chain for `node:https` `Agent` instances to be incorrectly set was fixed, thanks to [@nektro](https://github.com/nektro)!

```js#index.js
import { request } from 'node:https';
console.log(request('https://bun.sh/', { agent: false }).end().host);
// Before:        ConnectionRefused: Unable to connect. Is this computer able to access the url?
//                 path: "https://bun.sh:80/"
// Bun v1.1.35:   bun.sh
```

### Fixed: `node:net` `listen` with a unix socket path

Mishandling of the `path` option in `listen` from a server from `node:net` was fixed. The following code would throw an error before Bun v1.1.35 saying `TypeError: undefined is not an object`.

```js#index.js
import { createServer } from 'node:net';
const server = createServer();
server.listen({ path: 'socket-path' });
```

Fixed thanks to [@ippsav](https://github.com/ippsav)!

## Bugfixes

### Fixed: Unicode imports and unicode-escaped variable names

Several bugs have been fixed with importing and exporting variables with unicode characters, thanks to [@pfgithub](https://github.com/pfgithub)!

```js#index.js
import { mile𐃘nautical } from "./lib"
console.log(mile𐃘nautical(10)); // 12
```

```js#lib.js
export const mile𐃘nautical = int => Math.round(int * 1.150779448)
```

### Fixed: Windows named pipes with forward slashes

Bun was mishandling named pipes with forward slashes on Windows. This has been fixed thanks to [@cirospaciari](https://github.com/cirospaciari)!

Examples from our updated tests:

```js
test(`\\\\.\\pipe\\test\\${randomUUID()}`);
test(`\\\\?\\pipe\\test\\${randomUUID()}`);
test(`//?/pipe/test/${randomUUID()}`);
test(`//./pipe/test/${randomUUID()}`);
test(`/\\./pipe/test/${randomUUID()}`);
test(`/\\./pipe\\test/${randomUUID()}`);
test(`\\/.\\pipe/test\\${randomUUID()}`);
```

### Fixed: vscode debugger bugfix

The vscode debugger wasn't being enabled correctly unless the `--inspect` flag was used. This caused scoped variables to not be displayed in the debugger.

Fixed thanks to [@RiskyMH](https://github.com/RiskyMH)!

### Fixed: `node-fetch` `Request.url` bugfix

A bug was causing the `url` property of a `Request` object from `node-fetch` to be undefined. This was fixed by [@pfgithub](https://github.com/pfgithub)!

```js#index.js
import { Request } from 'node-fetch';
console.log(new Request('https://bun.sh/').url);
// Before: undefined
// After: 'https://bun.sh/'
```

### Fixed: Panic when parsing self closing JSX tags

A crash was fixed where a combination of JSX and function definitions would panic. The fix involved deleting the code used to check for self closing JSX tags, as it was unnecessary.

```jsx#index.jsx
function Input() {
    return <input>{(() => { if (true) { } })}</input>
}
function fn1() { return 1; }
function fn2() { return 2; }
```

Fixed thanks to [@ceymard](https://github.com/ceymard)!

### Fixed: Regression in `Bun.CryptoHasher`

In Bun v1.1.34 a regression was introduced where `Bun.CryptoHasher.update()` would throw an error when given a `Blob`.

```js#index.js
const hasher = new Bun.CryptoHasher("sha512")
hasher.update(new Blob(["hello blob!"]));
hasher.digest();
```

Fixed thanks to [@dylan-conway](https://github.com/dylan-conway)!

### Fixed: Migrating `package-lock.json` with a root dependency with scripts

An assertion failure was triggered by migrating a `package-lock.json` with a root dependency that had lifecycle scripts. Fixed by [@dylan-conway](https://github.com/dylan-conway)!

### Fixed: Assertion failure with non-existent `cafile` in `bun install`

An assertion failure was fixed when an absolute path to a non-existent `cafile` was provided to `bun install` on Windows.

```toml#bunfig.toml
[install]
cafile = "/does/not/exist/cafile.pem"
```

Fixed thanks to [@dylan-conway](https://github.com)!

### Fixed: Auto-install not working on Windows when symlinks are disabled

Bun [auto-install](https://bun.sh/docs/runtime/autoimport) uses symlinks to resolve dependencies from the global cache. On Windows, if symlinks weren't available, Bun would fail to import the dependency because the symlink wouldn't exist. This has been fixed by using [junctions](https://learn.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions#junctions) for auto-install links.

Thanks to [@dylan-conway](https://github.com/dylan-conway)!

### Fixed: Crash with non-existent preload script

A crash was fixed when a non-existent preload script was provided to Bun in combination with `--hot` or `--watch`.

### Fixed: `fetch` with method `OPTIONS` always returning `""`

A bug causing `fetch` to always return an empty string with method `OPTIONS` was fixed, thanks to [@Kapsonfire-DE](https://github.com/Kapsonfire-DE)!

```js#index.js
const res = await fetch('https://google.com', { method: 'OPTIONS' });
console.log(await res.text());
```

### Fixed: Bundler crash with `onLoad` plugins on copy-file loaders used on entrypoints

A crash was fixed in `Bun.build` when an `onLoad` plugin matched the entrypoint, and the entrypoint had a copy-file loader type (css with `experimentalCss: false`, wasm, ...). This was fixed by [@zackradisic](https://githhub.com/zackradisic)!

### Fixed: `setTimeout` with `node:util.promisify`

A regression from Bun v1.1.27 was fixed where `setTimeout` wouldn't have a promisify implementation if `node:timers` wasn't imported in the same file. The bug could be reproduced with the following code:

```sh
$ bun --print "require('util').promisify(setTimeout)(1000).then(() => 'done')"
```

This will now correctly wait one second and print `done`.

Fixed thanks to [@pfgithub](https://github.com/pfgithub)!

### Fixed: Hang on Linux

In Bun v1.1.34, [we allowed the garbage collector to do work while the event loop was asleep](bun-v1.1.34#long-running-processes-use-less-memory). This reduced Bun's memory usage in long-running processes. However, in some circumstances this change also [caused a deadlock that would hang the Bun process](https://github.com/oven-sh/bun/issues/14982). We're investigating how to keep the memory usage reduction without causing hangs, but in the meantime we've reverted the change from v1.1.34 so that Bun does not hang anymore.

## Thanks to 16 contributors!

- [@adhamu](https://github.com/adhamu)
- [@ceymard](https://github.com/ceymard)
- [@cirospaciari](https://github.com/cirospaciari)
- [@dylan-conway](https://github.com/dylan-conway)
- [@Electroid](https://github.com/Electroid)
- [@ippsav](https://github.com/ippsav)
- [@Jarred-Sumner](https://github.com/Jarred-Sumner)
- [@Kapsonfire-DE](https://github.com/Kapsonfire-DE)
- [@Nanome203](https://github.com/Nanome203)
- [@nektro](https://github.com/nektro)
- [@paperclover](https://github.com/paperclover)
- [@pfgithub](https://github.com/pfgithub)
- [@RiskyMH](https://github.com/RiskyMH)
- [@SunsetTechuila](https://github.com/SunsetTechuila)
- [@yamalight](https://github.com/yamalight)
- [@zackradisic](https://github.com/zackradisic)
