---
title: Bun v1.1.38
description: "Fixes 7 bugs (addressing 14 👍). Fixes debugger bug causing Bun to hang in VSCode terminal. Fixes crash in `postgres` npm package. Fixes TypeScript minification bug, console.log improvements, updated SQLite and c-ares. Adds `reusePort` option to `Bun.listen` and `node:net`, and fixes a bug in `Bun.FileSystemRouter.reload()`. Fixes rare crash in `fetch()`. Fixes assertion failure when re-assigning global modules in `--print` or `--eval`"
date: "2024-11-29T08:00:00.000Z"
author: jarred
---

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

This release fixes 7 bugs (addressing 14 👍), a debugger bug causing Bun to hang in VSCode terminal, a crash in `postgres` npm package, a TypeScript minification bug, console.log improvements, updated SQLite and c-ares, adds `reusePort` option to `Bun.listen` and `node:net`, fixes a bug in `Bun.FileSystemRouter.reload()`, fixes rare crash in `fetch()`, and fixes an assertion failure when re-assigning global modules in `--print` or `--eval`.

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

### Fixed: Debugger causing Bun to hang in VSCode terminal

A regression introduced in Bun v1.1.37 caused older versions of Bun to hang when run from the VSCode terminal in certain cases. This has been fixed.

### Fixed: Crash impacting `postgres` npm package

When using the `postgres` npm package, a crash could occur after upgrading from a TCP to a TLS socket when an application error occurred.

This has been fixed, thanks to [@cirospaciari](https://github.com/cirospaciari).

### Fixed: `allowHalfOpen` & `exclusive` being set to `true` incorrectly

An arguments validation regression introduced in Bun v1.1.34 caused `allowHalfOpen` to be set to `true` when `false` was passed.
This has been fixed, thanks to [@cirospaciari](https://github.com/cirospaciari).

This impacted `node:net` and `Bun.listen`.

### console.log improvements

{% raw %}

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">In the next version of Bun<br><br>console.log includes extended classes, null prototype, and prints `arguments` like an array, thanks to RiskyMH <a href="https://t.co/DIsYRb8mdj">pic.twitter.com/DIsYRb8mdj</a></p>&mdash; Bun (@bunjavascript) <a href="https://twitter.com/bunjavascript/status/1862439893886279753?ref_src=twsrc%5Etfw">November 29, 2024</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
{% /raw %}

### `reusePort` option in Bun.listen

The `reusePort` option has been added to `Bun.listen` and `node:net`. This is consistent with the behavior in `Bun.serve`.

### Fixed: Bun.FileSystemRouter.reload() missing new directory contents

A cache invalidation issue caused `reload()` in `Bun.FileSystemRouter` to miss new directory contents. This has been fixed, thanks to [@Kapsonfire-DE](https://github.com/Kapsonfire-DE).

### Fixed: Module resolution cache invalidation bug on Windows

A module resolution cache invalidation bug was causing incorrect behavior on Windows. This has been fixed, thanks to [@Kapsonfire-DE](https://github.com/Kapsonfire-DE).

### Fixed: File descriptor limit exceeded on musl

When Bun used the `prlimit` libc function on musl to ask how many file descriptors Bun can open, musl often lied and said Bun could only open 1024 file descriptors or so.

Now, we don't trust the result of `prlimit` function to tell us when the number is relatively low, and attempt to ask for a number greater than the reported limit.

### Updated SQLite from 3.45 -> 3.47

The version of SQLite `bun:sqlite` embeds on Linux and Windows has been updated from 3.45 to 3.47.

Release notes from the SQLite team can be found [here](https://www.sqlite.org/changes.html):

- [SQLite3 v3.46.0](https://www.sqlite.org/releaselog/3_46_0.html)
- [SQLite3 v3.47.0](https://www.sqlite.org/releaselog/3_47_0.html)

In Bun's repo, we've also setup auto-updating of native dependencies like sqlite, libarchive, etc to minimize delays for future updates.

### Fixed: Rare crash in fetch()

A difficult to trigger crash in `fetch()` has been fixed, thanks to [@cirospaciari](https://github.com/cirospaciari)

### Fixed: Re-assigning global modules in `--print` or `--eval`

When using `--print` or `--eval`, an assertion failure could occur when re-assigning global modules.

For example, the following code would trigger an assertion failure:

```js
// like in node, --print and --eval make a number of modules available globally.
const fs = require("node:fs");
```

### Fixed: TypeScript minification bug

The following code was minified incorrectly:

```ts
export class Foo {
  constructor(public name: string) {}
}
```

Before:

```ts-diff
class o{c;constructor(c){this.name=c}}export{o as Foo};
```

After:

```ts-diff
class o{name;constructor(c){this.name=c}}export{o as Foo};
```

We were incorrectly minifying the property name on the class instance, causing issues with `Object.keys` and other similar functions.

This has been fixed, thanks to [@heimskr](https://github.com/heimskr).

### Thanks to 11 contributors!

- [@alii](https://github.com/alii)
- [@cdfzo](https://github.com/cdfzo)
- [@cirospaciari](https://github.com/cirospaciari)
- [@heimskr](https://github.com/heimskr)
- [@jarred-sumner](https://github.com/jarred-sumner)
- [@kapsonfire-de](https://github.com/kapsonfire-de)
- [@nektro](https://github.com/nektro)
- [@nreilingh](https://github.com/nreilingh)
- [@paperclover](https://github.com/paperclover)
- [@riskymh](https://github.com/riskymh)
- [@snoglobe](https://github.com/snoglobe)
