{"slug": "bun-v1-3-6", "title": "Bun v1.3.6", "summary": "Here is a factual summary of the article:\n\nBun version 1.3.6 introduces three new built-in APIs. The `Bun.Archive` API allows for creating and extracting tar archives with optional gzip compression directly in JavaScript, while `Bun.JSONC.parse()` provides native support for parsing JSON files that contain comments and trailing commas. Additionally, `Bun.build()` now supports `metafile` and `files` options, enabling detailed bundle analysis and the inclusion of virtual files during the build process.", "body_md": "#### To install Bun\n\n```\ncurl -fsSL https://bun.sh/install | bash\nnpm install -g bun\npowershell -c \"irm bun.sh/install.ps1|iex\"\nscoop install bun\nbrew tap oven-sh/bun\nbrew install bun\ndocker pull oven/bun\ndocker run --rm --init --ulimit memlock=-1:-1 oven/bun\n```\n\n#### To upgrade Bun\n\n```\nbun upgrade\n```\n\n`Bun.Archive`\n\nAPI creates & extracts tarballs\n\n`Bun.Archive`\n\nAPI creates & extracts tarballsBun now includes a built-in `Bun.Archive`\n\nAPI for creating and extracting tar archives with optional gzip compression. This provides a fast, zero-dependency way to work with tarballs directly in JavaScript.\n\n``` js\n// Create an archive from files\nconst archive = new Bun.Archive({\n  \"hello.txt\": \"Hello, World!\",\n  \"data.json\": JSON.stringify({ foo: \"bar\" }),\n  \"binary.bin\": new Uint8Array([1, 2, 3, 4]),\n});\n\n// Or get as Blob/Uint8Array\nconst blob = await archive.blob();\nconst bytes = await archive.bytes();\n\n// Or read files:\nconst files = await archive.files();\nconst text = await archive.files(\"*.{txt,json}\");\n\n// Extract an existing tarball\nconst tarball = new Bun.Archive(await Bun.file(\"package.tar.gz\").bytes());\nconst fileCount = await tarball.extract(\"./output-dir\");\nconsole.log(`Extracted ${fileCount} files`);\n\n// Enable gzip compression (.tar.gz)\nconst compressed = new Bun.Archive(files, { compress: \"gzip\" });\n\n// Gzip with custom compression level (1-12)\nconst maxCompression = new Bun.Archive(files, { compress: \"gzip\", level: 12 });\n```\n\nYou can write archives to local files:\n\n```\n// Write to local file\nawait Bun.write(\"archive.tar\", archive);\nawait Bun.write(\"archive.tar.gz\", compressed);\n```\n\nOr even to S3:\n\n```\n// Write to S3\nawait Bun.write(\"s3://bucket/archive.tar.gz\", compressed);\nawait s3Client.write(\"archive.tar.gz\", compressed);\n```\n\nThe API supports creating archives from objects, `Blob`\n\n, `TypedArray`\n\n, or `ArrayBuffer`\n\ninputs. Async operations run on Bun's worker pool threads for non-blocking I/O.\n\n[Read more about Bun.Archive in Bun's docs](https://bun.com/docs/runtime/archive)\n\n`Bun.JSONC`\n\nAPI for parsing JSON with comments\n\n`Bun.JSONC`\n\nAPI for parsing JSON with commentsBun now provides a native `Bun.JSONC.parse()`\n\nAPI for parsing JSONC (JSON with Comments) — the format used by `tsconfig.json`\n\n, VS Code settings, and many other configuration files.\n\nThis allows you to parse JSON that includes:\n\n- Single-line comments (\n`//`\n\n) - Block comments (\n`/* */`\n\n) - Trailing commas in objects and arrays\n\n``` js\nconst config = Bun.JSONC.parse(`{\n  // Database configuration\n  \"host\": \"localhost\",\n  \"port\": 5432,\n  \"options\": {\n    \"ssl\": true, // trailing comma allowed\n  },\n}`);\n\nconsole.log(config.host); // \"localhost\"\n```\n\nThis is useful when reading `tsconfig.json`\n\nfiles, VS Code configuration, or any JSON files that use the relaxed JSONC format — without needing a third-party library.\n\n`metafile`\n\nin Bun.build\n\n`metafile`\n\nin Bun.build`Bun.build()`\n\nnow supports the `metafile`\n\noption, matching esbuild's format for seamless compatibility with existing bundle analysis tools.\n\nWhen enabled, the build result includes detailed metadata about all input files, output chunks, their sizes, imports, and exports—perfect for bundle size tracking, dependency visualization, and CI integration.\n\n``` js\nconst result = await Bun.build({\n  entrypoints: [\"./src/index.ts\"],\n  outdir: \"./dist\",\n  metafile: true,\n});\n\n// Analyze bundle sizes\nfor (const [path, meta] of Object.entries(result.metafile.inputs)) {\n  console.log(`${path}: ${meta.bytes} bytes`);\n}\n\nfor (const [path, meta] of Object.entries(result.metafile.outputs)) {\n  console.log(`${path}: ${meta.bytes} bytes`);\n}\n\n// Save for external tools like esbuild's bundle analyzer\nawait Bun.write(\"./dist/meta.json\", JSON.stringify(result.metafile));\n```\n\nFrom the CLI:\n\n```\nbun build ./src/index.ts --outdir ./dist --metafile ./dist/meta.json\n```\n\nThe metafile structure includes:\n\n: Map of source files with byte sizes, imports (with kind, path, and whether external), and module format`inputs`\n\n: Map of output chunks with byte sizes, contributing inputs, imports, exports, entry points, and associated CSS bundles`outputs`\n\n`files`\n\nin Bun.build\n\n`files`\n\nin Bun.build`Bun.build`\n\nnow supports a `files`\n\noption that lets you bundle virtual files that don't exist on disk, or override the contents of files that do exist.\n\n``` js\nconst result = await Bun.build({\n  entrypoints: [\"/app/index.ts\"],\n  files: {\n    \"/app/index.ts\": `\n      import { greet } from \"./greet.ts\";\n      console.log(greet(\"World\"));\n    `,\n    \"/app/greet.ts\": `\n      export function greet(name: string) {\n        return \"Hello, \" + name + \"!\";\n      }\n    `,\n  },\n});\n```\n\nIn-memory files take priority over files on disk, so you can override specific files while keeping the rest of your codebase unchanged:\n\n```\nawait Bun.build({\n  entrypoints: [\"./src/index.ts\"],\n  files: {\n    // Override config.ts with production values\n    \"./src/config.ts\": `\n      export const API_URL = \"https://api.production.com\";\n      export const DEBUG = false;\n    `,\n  },\n  outdir: \"./dist\",\n});\n```\n\nReal files on disk can import virtual files, and virtual files can import real files—useful for code generation, injecting build-time constants, or testing with mock modules:\n\n```\n// ./src/index.ts exists on disk and imports \"./generated.ts\"\nawait Bun.build({\n  entrypoints: [\"./src/index.ts\"],\n  files: {\n    \"./src/generated.ts\": `\n      export const BUILD_ID = \"${crypto.randomUUID()}\";\n      export const BUILD_TIME = ${Date.now()};\n    `,\n  },\n  outdir: \"./dist\",\n});\n```\n\nFile contents can be provided as `string`\n\n, `Blob`\n\n, `TypedArray`\n\n, or `ArrayBuffer`\n\n.\n\n`--compile-executable-path`\n\nCLI flag\n\n`--compile-executable-path`\n\nCLI flagWhen cross-compiling single-file executables with `bun build --compile`\n\n, Bun normally downloads the target platform's Bun executable from npm. The new `--compile-executable-path`\n\nflag lets you specify a local Bun executable instead.\n\nThis is useful for air-gapped environments, custom Bun builds, or when you want to avoid network requests during compilation.\n\n```\nbun build --compile --target=bun-linux-x64 \\\n  --compile-executable-path=/path/to/bun-linux-x64 app.ts\n```\n\nThis exposes the `executablePath`\n\noption that was already available in the JavaScript API:\n\n```\nawait Bun.build({\n  entrypoints: [\"./app.ts\"],\n  compile: true,\n  target: \"bun-linux-x64\",\n  executablePath: \"/path/to/bun-linux-x64\",\n});\n```\n\n`reactFastRefresh`\n\noption in `Bun.build`\n\n`reactFastRefresh`\n\noption in `Bun.build`\n\nThe `Bun.build`\n\nAPI now supports the `reactFastRefresh`\n\noption, matching the existing `--react-fast-refresh`\n\nCLI flag.\n\n``` js\nconst result = await Bun.build({\n  reactFastRefresh: true,\n  entrypoints: [\"src/App.tsx\"],\n  target: \"browser\",\n});\n```\n\nWhen enabled, the bundler injects React Fast Refresh transform code (`$RefreshReg$`\n\n, `$RefreshSig$`\n\n) into the output. This enables hot module replacement for React components without needing a separate plugin.\n\n`Response.json(object)`\n\nis now 3.5x faster\n\n`Response.json(object)`\n\nis now 3.5x faster`Response.json()`\n\nwas significantly slower than manually calling `JSON.stringify()`\n\n+ `new Response()`\n\n. This has been fixed by triggering JavaScriptCore's SIMD-optimized FastStringifier code path.\n\n``` js\nconst obj = {\n  items: Array.from({ length: 100 }, (_, i) => ({ id: i, value: `item-${i}` })),\n};\n\n// Now both approaches have equivalent performance\nResponse.json(obj);\nnew Response(JSON.stringify(obj));\n```\n\n**Before:**\n\n```\nResponse.json():                2415ms\nJSON.stringify() + Response():  689ms\nRatio:                          3.50x slower\n```\n\n**After:**\n\n```\nResponse.json():                ~700ms\nJSON.stringify() + Response():  ~700ms\nRatio:                          ~1.0x (parity)\n```\n\n[15% faster async/await](#15-faster-async-await)\n\nIn the next version of Bun & Safari\n\n— Bun (@bunjavascript)\n\nasync/await gets 15% faster, thanks to[@Constellation][pic.twitter.com/5htdmB0NqB][December 24, 2025]\n\n[30% faster Promise.race](#30-faster-promise-race)\n\nIn the next version of Bun & Safari\n\n— Bun (@bunjavascript)\n\nPromise.race() gets 30% faster thanks to[@__sosukesuzuki][pic.twitter.com/LWGQiF3UOR][December 24, 2025]\n\n[Faster ](#faster-buffer-indexof)`Buffer.indexOf`\n\n`Buffer.indexOf`\n\n`Buffer.indexOf`\n\nand `Buffer.includes`\n\nnow use SIMD-optimized search functions, providing significant speedups when searching for patterns in large buffers.\n\nIn a simple benchmark, this makes it up to 2x faster:\n\n```\n❯ bun bench/snippets/buffer-includes.js\nRun 99,999 times with a warmup:\n\n[21.90ms] 44,500 bytes .includes true\n[1.42s] 44,500 bytes .includes false\n\n❯ bun-1.3.5 bench/snippets/buffer-includes.js\nRun 99,999 times with a warmup:\n\n[25.52ms] 44,500 bytes .includes true\n[3.25s] 44,500 bytes .includes false\njs\nconst buffer = Buffer.from(\"a\".repeat(1_000_000) + \"needle\");\n\n// Both methods are now faster with SIMD acceleration\nbuffer.indexOf(\"needle\"); // single and multi-byte patterns\nbuffer.includes(\"needle\");\n```\n\n[Faster embedded ](#faster-embedded-node-files-on-linux)`.node`\n\nfiles on Linux\n\n`.node`\n\nfiles on LinuxIn the next version of Bun\n\n— Jarred Sumner (@jarredsumner)\n\nSingle-file executables load large embedded .node napi addons slightly faster on Linux[pic.twitter.com/RgQVj4bzEf][December 20, 2025]\n\n[Faster IPC](#faster-ipc)\n\nIn the next version of Bun\n\n— Jarred Sumner (@jarredsumner)\n\n9x faster cross-process JSON IPC with large messages[pic.twitter.com/aFUa3NmKLm][December 29, 2025]\n\n[Faster ](#faster-bun-spawnsync-on-linux-arm64)`Bun.spawnSync()`\n\non Linux ARM64\n\n`Bun.spawnSync()`\n\non Linux ARM64Fixed a performance regression where `Bun.spawnSync()`\n\nwas up to 30x slower than expected on Linux systems with high file descriptor limits.\n\nThe issue occurred because the `close_range()`\n\nsyscall number wasn't being defined at compile time on older glibc versions, causing Bun to fall back to iterating through all possible file descriptors (up to 65K) individually:\n\n``` js\n// Before: ~13ms per spawn with default ulimit\nfor (let i = 0; i < 100; i++) Bun.spawnSync([\"true\"]);\n\n// After: ~0.4ms per spawn\nfor (let i = 0; i < 100; i++) Bun.spawnSync([\"true\"]);\n```\n\n`--grep`\n\nflag for `bun test`\n\n`--grep`\n\nflag for `bun test`\n\n`bun test`\n\nnow supports `--grep`\n\nas an alias for `--test-name-pattern`\n\n, matching the familiar flag used by Jest, Mocha, and other test runners.\n\n```\n# All of these are now equivalent:\nbun test --grep \"should handle\"\nbun test --test-name-pattern \"should handle\"\nbun test -t \"should handle\"\n```\n\n[Faster JSON serialization across Bun APIs](#faster-json-serialization-across-bun-apis)\n\nJSON serialization is now ~3x faster for several internal APIs by using JSC's SIMD-optimized `FastStringifier`\n\ncode path:\n\n— faster debugging output`console.log`\n\nwith`%j`\n\nformat**PostgreSQL JSON/JSONB types**— faster database operations** MySQL JSON type**— faster database operations** Jest**— faster test output`%j`\n\n/`%o`\n\nformat specifiers\n\n[Fake Timers Now Work with ](#fake-timers-now-work-with-testing-library-react)`@testing-library/react`\n\n`@testing-library/react`\n\n`jest.useFakeTimers()`\n\nnow works correctly with `@testing-library/react`\n\nand `@testing-library/user-event`\n\n, fixing a bug where tests would hang indefinitely when using `user.click()`\n\nor similar interactions.\n\nTwo issues were resolved:\n\n**Fake timer detection**— Bun now sets`setTimeout.clock = true`\n\nwhen fake timers are enabled, which`@testing-library/react`\n\nchecks to determine whether to call`jest.advanceTimersByTime()`\n\nwhen draining the microtask queue.**Immediate timer handling**—`advanceTimersByTime(0)`\n\nnow correctly fires`setTimeout(fn, 0)`\n\ncallbacks. Per the HTML spec,`setTimeout(fn, 0)`\n\nis internally scheduled with a 1ms delay, but Jest and testing-library expect`advanceTimersByTime(0)`\n\nto fire these \"immediate\" timers.\n\n``` js\nimport { jest } from \"bun:test\";\nimport { render } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\n\nit(\"works with fake timers\", async () => {\n  jest.useFakeTimers();\n\n  const { getByRole } = render(<button>Click me</button>);\n  const user = userEvent.setup();\n\n  // This no longer hangs!\n  await user.click(getByRole(\"button\"));\n\n  jest.useRealTimers();\n});\n```\n\n`sql()`\n\nINSERT helper now respects `undefined`\n\nvalues\n\n`sql()`\n\nINSERT helper now respects `undefined`\n\nvaluesThe `sql()`\n\ntagged template helper now filters out `undefined`\n\nvalues in INSERT statements instead of converting them to `NULL`\n\n. This allows columns with `DEFAULT`\n\nvalues to properly use their database defaults when you pass `undefined`\n\n, rather than being overridden with `NULL`\n\n.\n\n```\n// Before: Would fail with \"null value violates not-null constraint\"\n// even if 'foo' has a DEFAULT in your schema\nconst [record] = await sql`\n  INSERT INTO \"MyTable\" ${sql({\n    foo: undefined,\n    id: Bun.randomUUIDv7(),\n  })}\n`;\n\n// After: Generates INSERT INTO \"MyTable\" (id) VALUES ($1)\n// The 'foo' column is omitted entirely, letting the database use its DEFAULT\n```\n\nThis also fixes a data loss bug in bulk inserts where columns were determined only from the first object in an array—values in later objects that weren't present in the first would be silently dropped:\n\n```\n// Now works correctly - 'bar' column is included even though\n// it's undefined in the first object\nawait sql`\n  INSERT INTO \"MyTable\" ${sql([{ foo: \"a\" }, { foo: \"b\", bar: \"c\" }])}\n`;\n```\n\n`Bun.hash.crc32`\n\nis now 20x faster\n\n`Bun.hash.crc32`\n\nis now 20x faster`Bun.hash.crc32`\n\nnow uses hardware-accelerated CRC32 instructions via zlib, making it approximately 20x faster on typical workloads.\n\nThe previous implementation used a software-only algorithm that didn't leverage modern CPU instructions like `PCLMULQDQ`\n\non x86 or native `CRC32`\n\ninstructions on ARM.\n\n``` js\nconst data = Buffer.alloc(1024 * 1024); // 1MB buffer\n\nBun.hash.crc32(data); // ~20x faster\n```\n\n| Benchmark (1MB) | Before | After |\n|---|---|---|\n`Bun.hash.crc32` | 2,644 µs | 124 µs |\n\nThanks to @sqdshguy for the contribution!\n\n[S3 Requester Pays Support](#s3-requester-pays-support)\n\nBun's S3 client now supports [Requester Pays buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RequesterPaysBuckets.html), allowing you to access public S3 buckets where the requester is charged for data transfer costs instead of the bucket owner.\n\nSet `requestPayer: true`\n\nwhen accessing objects in Requester Pays buckets:\n\n``` js\nimport { s3 } from \"bun\";\n\n// Reading from a Requester Pays bucket\nconst file = s3.file(\"data.csv\", {\n  bucket: \"requester-pays-bucket\",\n  requestPayer: true,\n});\nconst content = await file.text();\n\n// Writing to a Requester Pays bucket\nawait s3.write(\"output.json\", data, {\n  bucket: \"requester-pays-bucket\",\n  requestPayer: true,\n});\n```\n\nThis option works with all S3 operations including reads, writes, stat, and multipart uploads.\n\nThanks to [@d4mr](https://github.com/d4mr) for the contribution!\n\n[HTTP/HTTPS Proxy Support for WebSocket](#http-https-proxy-support-for-websocket)\n\nBun's `WebSocket`\n\nconstructor now supports connecting through HTTP and HTTPS proxies via the new `proxy`\n\noption. This enables WebSocket connections in corporate environments and other scenarios where direct connections aren't possible.\n\n```\n// Simple proxy URL\nnew WebSocket(\"wss://example.com\", {\n  proxy: \"http://proxy:8080\",\n});\n\n// With authentication\nnew WebSocket(\"wss://example.com\", {\n  proxy: \"http://user:pass@proxy:8080\",\n});\n\n// Object format with custom headers\nnew WebSocket(\"wss://example.com\", {\n  proxy: {\n    url: \"http://proxy:8080\",\n    headers: { \"Proxy-Authorization\": \"Bearer token\" },\n  },\n});\n\n// HTTPS proxy with TLS options\nnew WebSocket(\"wss://example.com\", {\n  proxy: \"https://proxy:8443\",\n  tls: { rejectUnauthorized: false },\n});\n```\n\nAll combinations of `ws://`\n\nand `wss://`\n\nconnections through both HTTP and HTTPS proxies are supported, along with Basic authentication and custom proxy headers. The `tls`\n\noption now also supports full TLS configuration (`ca`\n\n, `cert`\n\n, `key`\n\n, `passphrase`\n\n, etc.) matching the options available in `fetch`\n\n.\n\n[Updated SQLite to 3.51.2](#updated-sqlite-to-3-51-2)\n\nBun's embedded SQLite database (`bun:sqlite`\n\n) has been updated from version 3.51.1 to 3.51.2. This update includes fixes for edge cases with `DISTINCT`\n\nand `OFFSET`\n\nclauses, improved WAL mode locking behavior, and cursor renumberi\n\n[Bugfixes](#bugfixes)\n\n[Node.js compatibilty improvements](#node-js-compatibilty-improvements)\n\n- Fixed:\n`node:http`\n\nserver`CONNECT`\n\nevent handler not receiving pipelined data in the`head`\n\nparameter when sent in the same TCP segment as the request headers, causing compatibility issues with Cap'n Proto's KJ HTTP library used by Cloudflare's workerd runtime - Fixed: Temp directory resolution now correctly checks\n`TMPDIR`\n\n,`TMP`\n\n, and`TEMP`\n\nenvironment variables in order, matching Node.js's`os.tmpdir()`\n\nbehavior - Fixed: Memory leak in\n`node:zlib`\n\nBrotli, Zstd, and Zlib compression streams where calling`reset()`\n\nrepeatedly would allocate new encoder/decoder states without freeing previous ones - Fixed:\n`ws`\n\nmodule now correctly supports the`agent`\n\noption for proxy connections - Improved:\n`node:http2`\n\nmodule flow control\n\n[Bun APIs](#bun-apis)\n\n- Fixed: Rare edgecase in Subprocess stdin cleanup has been fixed\n- Fixed: HTTP client requests hanging when multiple concurrent requests fail proxy authentication (407 status code) without going through proxies directly\n- Fixed: Potential data corruption in\n`Bun.write()`\n\nfor files larger than 2GB - Fixed: Parsing bug with\n`NO_PROXY`\n\nenvironment variable involving empty entries - Fixed: Potential memory leak when proxying streaming responses through\n`Bun.serve()`\n\ninvolving`ReadableStream`\n\n- Fixed: Rare crash in Bun Shell impacting opencode\n- Fixed: Hypothetical crash caused in async zstd compression, scrypt, and transpiler operations where buffers could be garbage collected while still being accessed by worker threads\n- Fixed:\n`EBADF`\n\nerror when using`&>`\n\nredirect with Bun Shell builtin commands - Fixed: Bun SQL MySQL driver now correctly returns\n`Buffer`\n\nfor`BINARY`\n\n,`VARBINARY`\n\n, and`BLOB`\n\ncolumns instead of corrupted UTF-8 strings, matching the behavior of PostgreSQL and SQLite drivers. - Fixed: Bun SQL Postgres driver incorrectly throwing\n`InvalidByteSequence`\n\nerrors when parsing arrays containing strings or JSON larger than 16KB - Fixed: Bun SQL Postgres driver failing to read empty PostgreSQL arrays (e.g.,\n`INTEGER[]`\n\nstored as`{}`\n\n) with`ERR_POSTGRES_INVALID_BINARY_DATA`\n\nerror, particularly when reusing database connections - Fixed: JSON parsing errors from SQL database columns (e.g., PostgreSQL JSON/JSONB) now properly throw\n`SyntaxError`\n\nexceptions instead of silently returning empty values - Fixed: S3 credential validation now properly rejects invalid\n`pageSize`\n\n,`partSize`\n\n, and`retry`\n\nvalues that fall outside allowed ranges - Fixed:\n`Bun.write()`\n\nnow correctly respects the`mode`\n\noption when copying files from`Bun.file()`\n\n, instead of silently inheriting permissions from the source file - Improved: Bun now rejects null bytes in arguments passed to\n`Bun.spawn`\n\n,`Bun.spawnSync`\n\n, environment variables, and shell template literals. This prevents null byte injection attacks ([CWE-158](https://cwe.mitre.org/data/definitions/158.html)) - Improved: Bun now enforces stricter wildcard certificate matching following RFC 6125 Section 6.4.3 for improved security\n\n[Web APIs](#web-apis)\n\n- Fixed:\n`URLSearchParams.prototype.size`\n\nnot being configurable, which didn't align with the Web IDL specification - Fixed: WebSocket client now rejects decompression bombs by enforcing a 128MB limit on decompressed message size, preventing potential memory exhaustion attacks.\n- Fixed: Edgecase in\n`fetch()`\n\nwith a`ReadableStream`\n\nbody where streams were not being properly released in rare cases after the request completed, leading to a memory leak\n\n[bun install](#bun-install)\n\n- Fixed: Off-by-one bounds check errors in the bundler and package installer that could cause undefined behavior when array indices equal array length\n- Fixed: Reading\n`ca`\n\noption in`.npmrc`\n\nfor custom certificate authorities - Fixed: Rare crash in\n`bun install`\n\nwhen retrying failed HTTP requests (e.g., when GitHub API returns 504 errors) - Fixed:\n`bun --filter '*'`\n\nnot respecting dependency order when a package name is longer than 8 characters, causing builds to run concurrently instead of sequentially based on workspace dependencies - Fixed: Path traversal vulnerability via symlink in tarball extraction. Bun now rejects absolute symlink targets (paths starting with\n`/`\n\n) and relative symlinks that would escape the extraction directory via`../`\n\ntraversal\n\n[JavaScript minifier](#javascript-minifier)\n\n- Fixed: Dead code elimination producing invalid syntax like\n`{ ...a, x: }`\n\nwhen simplifying empty objects in spread contexts, which caused build failures in some Next.js 16 (Turbopack) projects\n\n[JavaScript bundler](#javascript-bundler)\n\n- Fixed:\n`bun build --compile`\n\nwith 8+ embedded files works as expected - Fixed: Debugger CLI configuration now properly propagates in single-file executables\n- Fixed: Bytecode-compiled CJS bundles silently failing to execute when the source file contains a shebang (\n`#!/usr/bin/env bun`\n\n) - Improved: internal data structure layouts in the bundler by packing boolean flags and reordering fields to minimize struct padding. This reduces memory overhead during large bundle builds by an estimated 200KB–1.5MB.\n\n[CSS Parser](#css-parser)\n\n- Fixed: CSS logical properties (e.g.,\n`inset-inline-end`\n\n) being stripped from bundler output when nested rules like pseudo-elements (`&:after`\n\n,`&:before`\n\n) were present in the same block\n\n[TypeScript types](#typescript-types)\n\n- Fixed: Missing TypeScript types for\n`autoloadTsconfig`\n\nand`autoloadPackageJson`\n\noptions in`Bun.build()`\n\nstandalone compilation config - Fixed: Incorrect TypeScript types and documentation for\n`bun:sqlite`\n\n`.run()`\n\nmethod now correctly show it returns a`Changes`\n\nobject with`changes`\n\nand`lastInsertRowid`\n\nproperties, not`undefined`\n\nor a`Database`\n\ninstance - Fixed:\n`FileSink.write()`\n\nreturn type now correctly includes`Promise<number>`\n\nfor async writes when the write is pending\n\n[Windows](#windows)\n\n- Speculative fix: crash on Windows machiens at start when very little memory is available\n- Fixed: \"integer does not fit in destination type\" error when reading files that are modified by another process or on network drives, where libuv returns unmapped error codes like\n`UV_UNKNOWN`\n\n[bun create](#bun-create)\n\n- Fixed: crash in\n`bun create`\n\nwhen using`--no-install`\n\nwith a template that has a`bun-create.postinstall`\n\ntask starting with \"bun \"", "url": "https://wpnews.pro/news/bun-v1-3-6", "canonical_source": "https://bun.com/blog/bun-v1.3.6", "published_at": "2026-01-13 01:12:07+00:00", "updated_at": "2026-05-22 20:41:49.608342+00:00", "lang": "en", "topics": ["developer-tools", "open-source"], "entities": ["Bun"], "alternates": {"html": "https://wpnews.pro/news/bun-v1-3-6", "markdown": "https://wpnews.pro/news/bun-v1-3-6.md", "text": "https://wpnews.pro/news/bun-v1-3-6.txt", "jsonld": "https://wpnews.pro/news/bun-v1-3-6.jsonld"}}