Skip to content
Latchkey

Bun bun.lockb binary lockfile diff / merge conflict in CI

Bun's bun.lockb is a binary file, so Git cannot show a readable diff or auto-merge it. Conflicting branches leave a corrupt or stale lockfile that then fails the frozen install in CI.

What this error means

A merge marks bun.lockb as conflicting, or a merged lockfile no longer matches package.json, so CI fails the frozen install even though each branch installed cleanly.

Terminal
CONFLICT (content): Merge conflict in bun.lockb
# after a forced resolution:
error: lockfile had changes, but lockfile is frozen

Common causes

Binary lockfiles cannot be merged

Git treats bun.lockb as an opaque blob, so two branches that both touched dependencies collide with no meaningful three-way merge.

A stale lockfile survives a bad conflict resolution

Picking one side of the conflict without relocking leaves a lockfile that does not match the merged package.json.

How to fix it

Regenerate the lockfile after any conflict

  1. Resolve package.json first, then delete the conflicted bun.lockb.
  2. Run bun install to regenerate a consistent lockfile.
  3. Commit the fresh bun.lockb.
Terminal
git checkout --theirs package.json
rm bun.lockb
bun install
git add bun.lockb package.json

Add a diff driver or use the text lockfile

Register bun.lockb with Bun's Git textconv so diffs are readable, or generate a text bun.lock (Bun 1.2+) that merges cleanly.

.gitattributes
# .gitattributes
*.lockb binary diff=lockb
# .git/config
[diff "lockb"]
  textconv = bun

How to prevent it

  • Regenerate bun.lockb after every merge that touches dependencies.
  • Register the Bun textconv diff driver so lockfile diffs are reviewable.
  • Consider the text bun.lock format for conflict-free merges.

Related guides

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