<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/bun-v1-4-2-ujk81ooxg" -->

---
title: Bun v1.4.2 | daily.dev
description: Bun v1.4.2 patches two regressions introduced in v1.4.1: a bun build variable name collision that broke Elysia imports with a SyntaxError, and an...
canonical: https://daily.dev/posts/bun-v1-4-2-ujk81ooxg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bun v1.4.2 | daily.dev
og:description: Bun v1.4.2 patches two regressions introduced in v1.4.1: a bun build variable name collision that broke Elysia imports with a SyntaxError, and an...
og:url: https://daily.dev/posts/bun-v1-4-2-ujk81ooxg
og:image: https://api.daily.dev/og/posts/UJk81ooxg.png
og:image:alt: Bun v1.4.2
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bun v1.4.2

**[Bun](https://daily.dev/sources/bun)** · 4 min read · 109 upvotes · 24 comments

## Summary

Bun v1.4.2 patches two regressions introduced in v1.4.1: a bun build variable name collision that broke Elysia imports with a SyntaxError, and an AsyncLocalStorage memory leak affecting timers and promises created inside store.exit() or nested store.run(). It also fixes a worker_threads 'online' event ordering bug that caused @discordjs/ws to hang, adds CMYK/YCCK JPEG decoding support to Bun.Image, pulls in roughly 350 upstream WebKit/JavaScriptCore commits fixing Intl, TypedArray, and Proxy correctness issues, and resolves several crash and hang bugs including a rare JIT crash, a musl GC crash, a bun install panic, and a double-close file descriptor bug on Linux.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bun.com/blog/bun-v1.4.2>

## Questions this post answers

### Why does bun build fail with 'Cannot declare a var variable that shadows a let/const/class variable' when importing Elysia?

This was a regression introduced in Bun v1.4.1 where bun build could rename a nested var to the same name as a let in the same block, producing invalid output like 'var exports2 = exports2'. It affected builds importing Elysia and could also silently give a let the name of a function parameter or catch binding, producing code with incorrect values. Bun v1.4.2 fixes this with a regression test added.

_Bun users tracking build-breaking regressions can follow release fixes like this one on daily.dev._

### Why is my AsyncLocalStorage store staying in memory longer than expected in Bun?

A regression in Bun v1.4.1 caused a timer, immediate, or pending promise created inside store.exit() or a nested store.run() to keep the outer store value alive for as long as that timer or promise existed, even though getStore() still returned the correct value. Only memory usage was affected, and this leak is fixed in Bun v1.4.2.

_Developers debugging memory leaks in async context tracking can follow Bun fixes like this on daily.dev._

### Why does @discordjs/ws hang when running under Bun's worker_threads?

Bun's Worker implementation from node:worker_threads did not emit the 'online' event first, unlike Node.js, causing consumers such as @discordjs/ws to hang because they missed a worker's first message. Bun v1.4.2 fixes the event ordering so 'online' fires before other messages, matching Node.js behavior.

_Teams debugging worker_threads hangs across runtimes can track compatibility fixes like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@suarezlifestyle** · 5 upvotes

> I use it at production but this runtime should start to be called Bug

**@ajaychoudhary80** · 4 upvotes

> Bun 1.4.2 is a good reminder that fast-moving runtimes need fast patch cycles too.

**@jntnlima** · 3 upvotes

> ![GIF](https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/d1/f1/qjmSQBjluecgVTO4b.gif)
>
> Fix fix fix

**@agustinbarrientos** · 2 upvotes

> I'd watch the AsyncLocalStorage fix closely in production because correct `getStore()` behavior made the leak unusually easy to miss

**@thecookingsenpai** · 2 upvotes

> Idk, I am still on the latest 1.3 version
> Last time I by mistake updated a project to 1.4, prod went down unpredictably after 5 hours.

## Similar posts on daily.dev

- [Bun v1.3.12](https://daily.dev/posts/bun-v1-3-12-f5ph0rgqu) · Bun · 140 upvotes · 2 comments
- [Bun v1.3.11](https://daily.dev/posts/bun-v1-3-11-dug54q8tb) · Bun · 89 upvotes · 2 comments
- [Anthropic bakes memory fixes into Bun 1.1.13 as developers complain of leaks](https://daily.dev/posts/anthropic-bakes-memory-fixes-into-bun-1-1-13-as-developers-complain-of-leaks-nnyc5gjq0) · DEVCLASS · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#nodejs](https://daily.dev/tags/nodejs), [#bun](https://daily.dev/tags/bun)

[View this post on daily.dev](https://daily.dev/posts/bun-v1-4-2-ujk81ooxg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Bun v1.4.2","url":"https://daily.dev/posts/bun-v1-4-2-ujk81ooxg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bun-v1-4-2-ujk81ooxg"},"datePublished":"2026-09-05T06:03:08.766Z","dateModified":"2026-09-13T20:48:57.490Z","description":"Bun v1.4.2 patches two regressions introduced in v1.4.1: a bun build variable name collision that broke Elysia imports with a SyntaxError, and an...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c4f9f8744dec19651c9586000409a465?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c4f9f8744dec19651c9586000409a465?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Bun","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Bun","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/9d715eb44dae4d74a2cebd8871d91a0d","url":"https://daily.dev/sources/bun"},"commentCount":24,"discussionUrl":"https://daily.dev/posts/bun-v1-4-2-ujk81ooxg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":109},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":24}],"keywords":"javascript,nodejs,bun","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Bun","item":"https://daily.dev/sources/bun"},{"@type":"ListItem","position":3,"name":"Bun v1.4.2"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/bun-v1-4-2-ujk81ooxg","comment":[{"@type":"Comment","text":"I use it at production but this runtime should start to be called Bug","datePublished":"2026-09-06T04:19:29.177Z","url":"https://daily.dev/posts/UJk81ooxg#c-hgb8yw5wk","author":{"@type":"Person","name":"Mateo Suarez","url":"https://daily.dev/suarezlifestyle","image":"https://avatars.githubusercontent.com/u/90749080?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"Bun 1.4.2 is a good reminder that fast-moving runtimes need fast patch cycles too.","datePublished":"2026-09-08T01:22:54.573Z","url":"https://daily.dev/posts/UJk81ooxg#c-Kox8mc6Io","author":{"@type":"Person","name":"Ajay Choudhary","url":"https://daily.dev/ajaychoudhary80","image":"https://media.daily.dev/image/upload/s--WkX8wDW2--/f_auto/v1780989706/avatars/avatar_QNZlI2SgVnNSx5PSRpCVx?_a=BAMAMiWQ0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"Fix fix fix","datePublished":"2026-09-07T01:06:14.583Z","url":"https://daily.dev/posts/UJk81ooxg#c-yeYdbMN8l","author":{"@type":"Person","name":"Jonathan Lima","url":"https://daily.dev/jntnlima","image":"https://avatars.githubusercontent.com/u/67848049?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"I’d watch the AsyncLocalStorage fix closely in production because correct getStore() behavior made the leak unusually easy to miss","datePublished":"2026-09-07T22:55:01.955Z","url":"https://daily.dev/posts/UJk81ooxg#c-yVxjcr0VU","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Idk, I am still on the latest 1.3 version\nLast time I by mistake updated a project to 1.4, prod went down unpredictably after 5 hours.","datePublished":"2026-09-08T12:30:09.047Z","url":"https://daily.dev/posts/UJk81ooxg#c-p3cvEwbqP","author":{"@type":"Person","name":"TheCookingSenpai","url":"https://daily.dev/thecookingsenpai","image":"https://media.daily.dev/image/upload/s--ffrIwc1G--/f_auto/v1757426086/avatars/avatar_ScKiWPtqpsvwHAvAS0jvG?_a=BAMClqZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/bun-v1-4-2-ujk81ooxg#faq","mainEntity":[{"@type":"Question","name":"Why does bun build fail with 'Cannot declare a var variable that shadows a let/const/class variable' when importing Elysia?","acceptedAnswer":{"@type":"Answer","text":"This was a regression introduced in Bun v1.4.1 where bun build could rename a nested var to the same name as a let in the same block, producing invalid output like 'var exports2 = exports2'. It affected builds importing Elysia and could also silently give a let the name of a function parameter or catch binding, producing code with incorrect values. Bun v1.4.2 fixes this with a regression test added. Bun users tracking build-breaking regressions can follow release fixes like this one on daily.dev."}},{"@type":"Question","name":"Why is my AsyncLocalStorage store staying in memory longer than expected in Bun?","acceptedAnswer":{"@type":"Answer","text":"A regression in Bun v1.4.1 caused a timer, immediate, or pending promise created inside store.exit() or a nested store.run() to keep the outer store value alive for as long as that timer or promise existed, even though getStore() still returned the correct value. Only memory usage was affected, and this leak is fixed in Bun v1.4.2. Developers debugging memory leaks in async context tracking can follow Bun fixes like this on daily.dev."}},{"@type":"Question","name":"Why does @discordjs/ws hang when running under Bun's worker_threads?","acceptedAnswer":{"@type":"Answer","text":"Bun's Worker implementation from node:worker_threads did not emit the 'online' event first, unlike Node.js, causing consumers such as @discordjs/ws to hang because they missed a worker's first message. Bun v1.4.2 fixes the event ordering so 'online' fires before other messages, matching Node.js behavior. Teams debugging worker_threads hangs across runtimes can track compatibility fixes like this on daily.dev."}}]}
```

