Skip to content
Latchkey

Bun "node:" Module Compatibility Errors in CI

Bun aims for Node compatibility but does not implement every node: built-in API or native binding. Code that runs under Node can fail under Bun when it hits an unimplemented API or a native addon Bun cannot load.

What this error means

Under bun run, code fails with "not implemented" for a node: API (or a method on one), or a native addon fails to load. The same code works under Node, which points at a Bun compatibility gap.

bun output
error: "node:v8".serialize is not implemented in Bun yet.
# or
error: Cannot load native addon "node_modules/.../binding.node" under Bun

Common causes

Unimplemented Node built-in API

A specific node: module or method is not yet implemented in Bun, so calling it throws at runtime.

Native addon Bun cannot load

A dependency relying on a native .node binding built for Node’s ABI may not load under Bun.

How to fix it

Use a Bun-native or portable alternative

Replace the unsupported API/addon with a Bun-native API or a pure-JS library.

TypeScript
// instead of an unsupported node: API or native addon:
import { Database } from "bun:sqlite";  // Bun-native SQLite
// or choose a pure-JS dependency with no native binding

Run that workload under Node

  1. Check Bun’s Node-compatibility status for the specific API you use.
  2. If a critical dependency needs an unimplemented API or native addon, run that job under Node instead of Bun.
  3. Pin the Bun version and re-test as compatibility improves across releases.

How to prevent it

  • Verify node: API and native-addon support in Bun before adopting a dependency.
  • Prefer Bun-native or pure-JS libraries for Bun-run workloads.
  • Pin the Bun version so compatibility behavior is stable.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →