---
title: Bun v1.1.16
description: 'Fixes 41 bugs (addressing 221 👍). lcov code coverage reports in bun test, Install dependencies from private git repositories including Gitlab and Bitbucket. `Buffer.from(string, "base64")` gets 6x - 30x faster on large input. Bug fixes to `bun patch`, `bun install`, N-AIi addons, transpiler bugfixes and Node.js compatibility improvements.'
date: "2024-06-23T02:34:19.176Z"
author: chloe
---

Bun v1.1.16 is here! This release fixes 41 bugs (addressing 221 👍). lcov code coverage reports in bun test, Install dependencies from private git repositories including Gitlab and Bitbucket. `Buffer.from(string, "base64")` gets 6x - 30x faster on large input. Bug fixes to `bun patch`, `bun install`, N-APi addons, transpiler bugfixes and Node.js compatibility improvements.

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

#### Previous releases

- [`v1.1.14`](/blog/bun-v1.1.14) fixes 63 bugs (addressing 519 👍). Patch node_modules with `bun patch`. ORM-less object mapping in `bun:sqlite`. Log all `fetch()` calls as a `curl` command. Node.js compatibility improvements. bun install bugfixes, `bun:sqlite` bugfixes, Windows bugfixes. And more.
- [`v1.1.10`](/blog/bun-v1.1.10) fixes 20 bugs. 2x faster uncached bun install on Windows. `fetch()` uses up to 2.8x less memory. Several bugfixes to bun install, sourcemaps, Windows reliability improvements and Node.js compatibility improvements
- [`v1.1.0`](/blog/bun-v1.1) Bundows. Windows support is here!

#### 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
```

### LCOV code coverage reporter

When using `bun test --coverage`, coverage reports can be exported to the standard lcov format using `--coverage-reporter lcov`

```sh
$ bun test --coverage --coverage-reporter lcov
```

By default this outputs a `coverage/lcov.info` file. The coverage directory can be changed with `--coverage-dir`

To always enable coverage reporting, two new options have been added to `bunfig.toml`:

```toml#bunfig.toml
[test]

# always enable coverage
coverage = true

# new
coverageReporter = ["text", "lcov"]  # default ["text"]
coverageDir = "./path-to-folder"  # default "coverage"
```

Thanks to [@exoego](https://github.com/exoego) for implementing this.

### bun install git ssh repositories

bun install now supports authenticating via ssh to install dependencies from private git repositories. These are cloned using your git SSH key via `git clone`.

```sh
$ bun i git@github.com:paperclover/secret-utilities.git

installed secret-utilities@git+ssh://git@github.com:paperclover/secret-utilities.git#5a7279074f22e98d64507cb5149633c73897395f

1 package installed [904.00ms]
```

This makes `bun install` easier to use when working with private repositories from Gitlab, Bitbucket, or other git hosting services. GitHub repositories were sometimes impacted by this issue, but less frequently.

Thanks to [@Eckhardt-D](https://github.com/Eckhardt-D) for implementing this!

### `Buffer.from(string, "base64")` gets 6x-30x faster on large input

By changing our base64 decoding implementation to using [simdutf](https://github.com/simdutf/simdutf), using `Buffer.from(string, "base64")` is much faster, especially on large input:

{% raw %}

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">In the next version of Bun<br><br>`Buffer.from(str, &quot;base64&quot;)` gets 6x - 30x faster on large input, thanks to <a href="https://twitter.com/lemire?ref_src=twsrc%5Etfw">@lemire</a>&#39;s simdutf <a href="https://t.co/iFgI0Vv3sQ">pic.twitter.com/iFgI0Vv3sQ</a></p>&mdash; Jarred Sumner (@jarredsumner) <a href="https://twitter.com/jarredsumner/status/1803570321309704258?ref_src=twsrc%5Etfw">June 19, 2024</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

{% /raw %}

### Output Source Map URLs in `bun build`

To tell browser devtools where to find sourcemaps, tooling inserts a `//# sourceMappingURL=` comment at the end of files.

Previously, Bun didn't expose a way to link to external, non-inline sourcemaps via this comment.

You can now use `--sourcemap=linked` to tell Bun to insert a `//# sourceMappingURL=` comment at the end of the bundled file, linking to the external sourcemap.

```sh
$ bun build src/app.tsx --outdir ./dist --sourcemap=linked --minify
```

This will produce the directory `dist` with `app.js` and `app.js.map`, and the comment `//# sourceMappingURL=app.js.map` to load the sourcemap for debugging.

Thanks to [@paperclover](https://github.com/paperclover) for implementing this.

### `console.log` now prints non-indexed properties on arrays

Bun now shows prints non-indexed properties on arrays, for example:

```ts#non-indexed-properties.ts
const arr = ['a', 'b', 'c'];
arr['five'] = 5;

console.log(arr);
```

```sh
$ bun non-indexed-properties.ts
[ "a", "b", "c", five: 5 ]
```

### Fixed: WebSocket connection `error` event now includes a `message`

When a WebSocket connection fails, the error event now includes a `message` property with a more detailed error message.

```ts
const ws = new WebSocket("ws://localhost:8080");
ws.addEventListener("error", (error) => {
  console.log(error.message);
});

// The message previously only was in the "close" event:
ws.addEventListener("close", (close) => {
  console.log(close);
});
```

This prints the following error message:

```ts
WebSocket connection to 'ws://localhost:8080/' failed: Failed to connect
```

Instead of only including relevant information in the `close` event, the `error` event on connection failure now includes a `message` property with an error message.

### Fixed: Crash in console.log with WebSocket connection errors

When a WebSocket fails to connect, it emits both the `error` and `close` events.

```ts
const ws = new WebSocket("ws://localhost:8080");
ws.addEventListener("error", (error) => {
  // Connection error emitted
});
ws.addEventListener("close", () => {
  // Connection did not fully open, but it is still closed
});
```

Previously, printing `console.log(error)` from a WebSocket connection error would sometimes cause a crash. The code incorrectly assumed that an `ErrorEvent` always contained a non-null `error`. This has been fixed, and our test coverage has been improved to cover this edge case.

### Fixed: Bun Shell & bun run with non-ascii cwd on Windows

A bug affecting Bun Shell and `bun run` when run in a directory with non-ascii characters has been fixed thanks to [@dylan-conway](https://github.com/dylan-conway).

### Fixed: non-ascii characters in TypeScript enums

An enum with non-ascii keys would get mangled. This has been fixed.

```ts#unicode-enum.ts
enum X {
  a,
  b,
  ç,
}
console.log(X);
```

### Fixed: Assertion failure with experimental decorator on abstract property

An assertion failure would occur when using an experimental TypeScript decorator on an abstract property. This has been fixed, thanks to [@forcefieldsovereign](https://github.com/forcefieldsovereign).

### Fixed: ZWJ and ZWNJ characters in transpiler

A crash that would occur when a file contained a Zero Width Joiner (ZWJ) or Zero Width Non-Joiner (ZWNJ) character inside of a property name has been fixed.

### Fixed: Crash in `module.mock`

An edge case with using `module.mock` on modules that previously failed to load causing a crash has been fixed thanks to [@paperclover](https://github.com/paperclover).

### Fixed: `process.execArgv`

`process.execArgv` lets you return arguments passed to the Bun runtime, in comparison to the program arguments in `process.argv`. In certain cases, non-runtime parameters were mistakenly included. Thanks to [@paperclover](https://github.com/paperclover) for fixing this.

### Fixed: Ignore optional dependencies that do not exist

Before, installing the package `@laihoe/demoparser2` would fail due to an optional dependency on a package that was never published to NPM. Bun now matches `npm`'s behavior by simply ignoring these missing packages, since they are declared as optional dependencies.

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

### Fixed: N-API modules re-assigning `module.exports`

A bug where Bun incorrectly handled N-API modules that re-assigned `module.exports` has been fixed.

Previously, Bun would ignore the return value of the module, causing the module to not be loaded correctly. This has been fixed, and Bun now correctly loads N-API modules that re-assign `module.exports`. This waas most noticable when `module.exports` was assigned to a function.

Along the way, we've also fixed a potential crash when loading N-API modules that take a long time to initialize.

### Fixed: `bun:sqlite`'s `changes` field always 0 in statement.run()

A bug in prepared statements caused `db.prepare(...).run(...)` to return 0 in certain cases instead of the number of changes from the statement. `db.run(...)` was not affected.

### Fixed: `bun patch` in workspace packages

Bugs related to `bun patch --commit` diffing files in nested `node_modules` directories causing patch failures have been fixed.

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

### Internal: Bun updated Zig to version 0.13

In [#9965](https://github.com/oven-sh/bun/pull/9965), Bun was upgraded to use the latest release of the Zig compiler. This makes Bun easier to contribute to, as there are a handful of language server, build system, and overall code quality improvements.

Bug fixes within the Zig standard library have fixed some bugs in Bun; most notably the Windows [fix for handling WTF-16](https://github.com/ziglang/zig/pull/19005) (a looser version of UTF-16) within paths and environment. This fixes some rare edge cases where the error `InvalidUTF8` was reported with very little context. Thanks to [@squeek502](https://github.com/squeek502).

One important build system improvement for the team and contributors is the ability to ensure that all platforms (Linux, Mac, and Windows) compile successfully without having to wait for CI to finish running. Contributors can now test-compile the code for all targets with `bun run zig-check` in the Bun repository.

![](https://github.com/oven-sh/bun/assets/24465214/bea03cf5-0239-491f-b247-666deded9892)

### Thanks to 9 contributors!

- [@bomberstudios](https://github.com/bomberstudios)
- [@dylan-conway](https://github.com/dylan-conway)
- [@Eckhardt-D](https://github.com/Eckhardt-D)
- [@exoego](https://github.com/exoego)
- [@forcefieldsovereign](https://github.com/forcefieldsovereign)
- [@Jarred-Sumner](https://github.com/Jarred-Sumner)
- [@mohiwalla](https://github.com/mohiwalla)
- [@paperclover](https://github.com/paperclover)
- [@surprisedpika](https://github.com/surprisedpika)
- [@zackradisic](https://github.com/zackradisic)
