---
title: "Bun v1.1.40"
description: "Bun v1.1.40 fixes 14 bugs and adds an `install.saveTextLockfile` option in bunfig.toml so the text-based `bun.lock` format can be the default ahead of Bun v1.2."
url: "https://swe.quest/articles/bun-v1-1-40-9a3067ef2dfd320e"
canonical: "https://bun.com/blog/bun-v1.1.40"
source: "Bun"
published: "2024-12-18"
difficulty: "medium"
kind: "Release"
reading_minutes: 2
tags: ["javascript","runtimes","build-systems"]
---

# Bun v1.1.40

A post on [Bun](https://swe.quest/sources/bun.md), published 2024-12-18, 2 min read, Release. Original: [https://bun.com/blog/bun-v1.1.40](https://bun.com/blog/bun-v1.1.40)

## Summary

Bun v1.1.40 fixes 14 bugs and adds an \`install.saveTextLockfile\` option in bunfig.toml so the text-based \`bun.lock\` format can be the default ahead of Bun v1.2. It fixes a v1.1.39 regression where \`process.on\` could crash in Workers, single-file executables or macros, and corrects N-API BigInt handling (trailing zeros in \`napi\_create\_bigint\_words\` and the unset \`lossless\` flag) that affected DuckDB. Git/GitHub dependency installs are more reliable, because their dependencies aren't known until download. A WebKit upgrade fixes DFG JIT edge cases and a lock that could unlock too early.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)

## Prerequisites

- JavaScript package managers ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- Node-API basics ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Bun, bun.lock, bunfig.toml, N-API, DuckDB, WebKit, DFG JIT

## Related posts

- [Bun v1.1.39](https://swe.quest/articles/bun-v1-1-39-87acf329d791d87e.md): Bun · 2024-12-17 · Medium · 9 min read · JavaScript, Runtimes & VMs, Build systems, Testing, Memory management
  Bun v1.1.39 introduces bun.lock, a human-readable text lockfile that improves git diffs and works with tools like Dependabot and Renovate, and makes cached bun install 30% faster.
- [Bun's new text-based lockfile](https://swe.quest/articles/bun-s-new-text-based-lockfile-e3afd1bb6d635a28.md): Bun · 2024-12-17 · Medium · 5 min read · Build systems, JavaScript, Performance engineering, Zig
  Bun v1.1.39 introduces bun.lock, a JSONC text lockfile enabled via \`bun install --save-text-lockfile\`, replacing the hard-to-review binary bun.lockb and planned as the default in Bun v1.2.
- [Bun v1.1.34](https://swe.quest/articles/bun-v1-1-34-d8b685a5be9be177.md): Bun · 2024-11-02 · Medium · 7 min read · JavaScript, Runtimes & VMs, Build systems
  Bun v1.1.34 fixes 64 bugs and adds Bun.randomUUIDv7() for sortable, database-friendly IDs, more aggressive garbage collection while idle in the event loop to cut memory in long-running processes, and Node-API type tagging (napi\_type\_tag\_object/napi\_check\_object\_type\_tag) that unblocks tree-sitter.
- [Bun v1.0.7](https://swe.quest/articles/bun-v1-0-7-b09b1a042388dc2a.md): Bun · 2023-10-20 · Medium · 6 min read · JavaScript, Runtimes & VMs, Build systems
  Bun v1.0.7 fixes 59 bugs and adds support for optional peer dependencies in \`bun install\`, so packages marked optional in \`peerDependenciesMeta\` are no longer installed unless the root project lists them.
- [Bun v1.2.2](https://swe.quest/articles/bun-v1-2-2-430cc9d4f8048e2e.md): Bun · 2025-02-01 · Medium · 8 min read · JavaScript, Runtimes & VMs, Memory management
  Bun v1.2.2 fixes 38 bugs and cuts idle JavaScript memory usage by 10–30% (28% for Next.js, 11% for Elysia).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
