<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m" -->

---
title: Bun v1.4.1: HTTP/2 support, better tree-shaking, and 202...
description: Bun v1.4.1 ships 202 bug fixes plus new capabilities across runtime, bundler, and package manager. The runtime adds HTTP/2 support in Bun.serve(), streaming...
canonical: https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bun v1.4.1: HTTP/2 support, better tree-shaking, and 202 bug fixes | daily.dev
og:description: Bun v1.4.1 ships 202 bug fixes plus new capabilities across runtime, bundler, and package manager. The runtime adds HTTP/2 support in Bun.serve(), streaming...
og:url: https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m
og:image: https://api.daily.dev/og/posts/neVjTCi5M.png
og:image:alt: Bun v1.4.1: HTTP/2 support, better tree-shaking, and 202 bug fixes
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.1: HTTP/2 support, better tree-shaking, and 202 bug fixes

**[Collections](https://daily.dev/sources/collections)** · 2 min read · 97 upvotes · 7 comments

## Summary

Bun v1.4.1 ships 202 bug fixes plus new capabilities across runtime, bundler, and package manager. The runtime adds HTTP/2 support in Bun.serve(), streaming writes in Bun.write(), WebSocket backpressure control via pause()/resume(), reduced idle memory usage, faster compiled executable startup, and Node.js compatibility improvements including 9x faster buffer reads/writes and 2x faster AsyncLocalStorage. The bundler now tree-shakes through dynamic import() and export * as patterns, shrinking zod bundles by 79% in testing, alongside smaller code-split chunks and module preloading for browser builds. The package manager gains --offline and --prefer-offline flags for bun install and self-contained node_modules for workspace packages.

## Content

Bun v1.4.1 is out, fixing 202 issues and shipping a fairly broad set of improvements across the runtime, bundler, and package manager.

## Runtime changes

`Bun.serve` now supports HTTP/2 on the same port as HTTP/1.1. `Bun.write()` streams response bodies to disk rather than buffering them in memory first. WebSocket clients get `pause()` and `resume()` methods for backpressure control.

Idle memory usage is noticeably lower - one of the last PRs before release specifically targeted long-running servers and CLIs that spend most of their time doing nothing. Early reports from users confirm less memory on cold start and lower CPU usage overall.

Performance gains include 9x faster Buffer reads/writes and 2x faster AsyncLocalStorage.

## Bundler

This is probably the biggest area of improvement. The bundler now tree-shakes through dynamic `import()` calls and `export * as` patterns - zod bundles drop by 79% as a result. Code splitting produces fewer and smaller chunks, and browser builds gain module preloading.

On a 200-route React app over a simulated 4G connection, navigation between routes is meaningfully faster.

Compiled executables also start faster and produce smaller bytecode.

## Package manager

`bun install` adds `--offline` and `--prefer-offline` flags, and workspace packages now get self-contained `node_modules`.

## Node.js compatibility

Fixes cover `node:http`, `node:http2`, `node:tls`, `node:fs`, `crypto`, and more.

## Questions this post answers

### What's new in Bun 1.4.1?

Bun 1.4.1 fixes 202 issues and adds HTTP/2 support to Bun.serve() on the same port as HTTP/1.1, streams Bun.write() output to disk instead of buffering in memory, and gives WebSocket clients pause() and resume() methods for backpressure control. It also reduces idle memory usage and speeds up compiled executable startup with smaller bytecode.

_Track Bun's fast-moving runtime releases on daily.dev before upgrading production services._

### How much faster is Node.js compatibility in Bun 1.4.1?

Buffer reads and writes are 9x faster and AsyncLocalStorage is 2x faster in Bun 1.4.1, alongside fixes across node:http, node:http2, node:tls, node:fs, and crypto modules. These changes target Node.js compatibility rather than Bun-native APIs, helping ported Node.js applications run faster under Bun.

_Developers weighing a Node.js to Bun migration can follow compatibility gains like these on daily.dev._

### Does Bun's bundler tree-shake dynamic imports?

Yes, Bun's bundler in version 1.4.1 now tree-shakes through dynamic import() and export * as patterns, which previously blocked dead code elimination. In testing, this shrank zod bundles by 79%. Code splitting also produces fewer and smaller chunks, and browser builds gain module preloading, improving route navigation speed on a 200-route React app over simulated 4G.

_Anyone chasing smaller bundle sizes can follow bundler improvements like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@jenueldev** · 2 upvotes

> The combination I find most interesting is streaming Bun.write() to disk alongside WebSocket pause/resume: both make backpressure and memory use explicit instead of letting large workloads hide behind buffering. The 79% zod reduction is impressive too, though I’d love to see how much of that carries over to typical mixed-dependency apps.

**@raunakpersonal** · 2 upvotes

> The dynamic import tree-shaking improvement is the part I would validate first in a real app. Has anyone compared chunk count and cold navigation before and after upgrading, rather than only the synthetic 200-route benchmark?

**@petecapecod** · 1 upvotes

> wow that's a lot of great fixes and features. Go Bun get down with your bad self

**@deepjoshi\_dev** · 1 upvotes

> I like bun but after acquisition by anthropic it just feels me up with uncertainty.

**@gtxpro1** · 0 upvotes

> ![GIF](https://static.klipy.com/ii/da290b156d64898341638f3c299e7478/e7/a3/i2aN8Fz9.gif)

## Similar posts on daily.dev

- [Bun v1.3.2](https://daily.dev/posts/bun-v1-3-2-dhlhg7jjh) · Bun · 35 upvotes · 4 comments
- [Bun: a faster JavaScript runtime](https://daily.dev/posts/bun-a-faster-javascript-runtime-hnnh26fm5) · Flavio Copes · 0 upvotes · 0 comments
- [Bun v1.4.2](https://daily.dev/posts/bun-v1-4-2-ujk81ooxg) · Bun · 108 upvotes · 24 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-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m)

```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.1: HTTP/2 support, better tree-shaking, and 202 bug fixes","url":"https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m"},"datePublished":"2026-09-04T12:14:09.338Z","dateModified":"2026-09-05T09:57:47.852Z","description":"Bun v1.4.1 ships 202 bug fixes plus new capabilities across runtime, bundler, and package manager. The runtime adds HTTP/2 support in Bun.serve(), streaming...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3adc19d6d0f64de91813c83ecf52fbc5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3adc19d6d0f64de91813c83ecf52fbc5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Collections","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":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":7,"discussionUrl":"https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":97},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":7}],"keywords":"javascript,nodejs,bun","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"Bun v1.4.1: HTTP/2 support, better tree-shaking, and 202 bug fixes"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m","comment":[{"@type":"Comment","text":"The combination I find most interesting is streaming Bun.write() to disk alongside WebSocket pause/resume: both make backpressure and memory use explicit instead of letting large workloads hide behind buffering. The 79% zod reduction is impressive too, though I’d love to see how much of that carries over to typical mixed-dependency apps.","datePublished":"2026-09-05T09:23:27.634Z","url":"https://daily.dev/posts/neVjTCi5M#c-BGPtToGpl","author":{"@type":"Person","name":"Jenuel Oras Ganawed","url":"https://daily.dev/jenueldev","image":"https://media.daily.dev/image/upload/s--BadmiNyj--/f_auto/v1787625077/avatars/avatar_JJtZr4Sjm?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"The dynamic import tree-shaking improvement is the part I would validate first in a real app. Has anyone compared chunk count and cold navigation before and after upgrading, rather than only the synthetic 200-route benchmark?","datePublished":"2026-09-05T15:53:01.251Z","url":"https://daily.dev/posts/neVjTCi5M#c-Alrpa1Taz","author":{"@type":"Person","name":"Raunak Personal","url":"https://daily.dev/raunakpersonal","image":"https://media.daily.dev/image/upload/s--OBhKXyMB--/f_auto/v1773905110/avatars/avatar_fvBRceLNSvaKf8Z9ZAmaT?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"wow that’s a lot of great fixes and features. Go Bun get down with your bad self","datePublished":"2026-09-05T12:15:12.222Z","url":"https://daily.dev/posts/neVjTCi5M#c-768P459Xd","author":{"@type":"Person","name":"Peter Cruckshank","url":"https://daily.dev/petecapecod","image":"https://media.daily.dev/image/upload/s--ZJhQyKws--/f_auto/v1721235024/avatars/avatar_A9xh33q0QoxtkGoJRCosp"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"I like bun but after acquisition by anthropic it just feels me up with uncertainty.","datePublished":"2026-09-07T14:34:33.042Z","url":"https://daily.dev/posts/neVjTCi5M#c-OMGa6CMXz","author":{"@type":"Person","name":"Deep Joshi","url":"https://daily.dev/deepjoshi_dev","image":"https://media.daily.dev/image/upload/s--TdY8j8Aa--/f_auto/v1776506972/avatars/avatar_aSUkzUQS97QJpQRxKMe49?_a=BAMAMiWQ0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"","datePublished":"2026-09-07T09:21:32.554Z","url":"https://daily.dev/posts/neVjTCi5M#c-lGJqGAQ95","author":{"@type":"Person","name":"NguyenDat","url":"https://daily.dev/gtxpro1","image":"https://lh3.googleusercontent.com/a-/AOh14Gj6dJn9PAc86GicePx7UzdLxzXxJXuU3IjYkyK4=s100"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/bun-v1-4-1-http-2-support-better-tree-shaking-and-202-bug-fixes-nevjtci5m#faq","mainEntity":[{"@type":"Question","name":"What's new in Bun 1.4.1?","acceptedAnswer":{"@type":"Answer","text":"Bun 1.4.1 fixes 202 issues and adds HTTP/2 support to Bun.serve() on the same port as HTTP/1.1, streams Bun.write() output to disk instead of buffering in memory, and gives WebSocket clients pause() and resume() methods for backpressure control. It also reduces idle memory usage and speeds up compiled executable startup with smaller bytecode. Track Bun's fast-moving runtime releases on daily.dev before upgrading production services."}},{"@type":"Question","name":"How much faster is Node.js compatibility in Bun 1.4.1?","acceptedAnswer":{"@type":"Answer","text":"Buffer reads and writes are 9x faster and AsyncLocalStorage is 2x faster in Bun 1.4.1, alongside fixes across node:http, node:http2, node:tls, node:fs, and crypto modules. These changes target Node.js compatibility rather than Bun-native APIs, helping ported Node.js applications run faster under Bun. Developers weighing a Node.js to Bun migration can follow compatibility gains like these on daily.dev."}},{"@type":"Question","name":"Does Bun's bundler tree-shake dynamic imports?","acceptedAnswer":{"@type":"Answer","text":"Yes, Bun's bundler in version 1.4.1 now tree-shakes through dynamic import() and export * as patterns, which previously blocked dead code elimination. In testing, this shrank zod bundles by 79%. Code splitting also produces fewer and smaller chunks, and browser builds gain module preloading, improving route navigation speed on a 200-route React app over simulated 4G. Anyone chasing smaller bundle sizes can follow bundler improvements like this on daily.dev."}}]}
```

