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.
CONFLICT (content): Merge conflict in bun.lockb
# after a forced resolution:
error: lockfile had changes, but lockfile is frozenCommon 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
- Resolve package.json first, then delete the conflicted
bun.lockb. - Run
bun installto regenerate a consistent lockfile. - Commit the fresh
bun.lockb.
git checkout --theirs package.json
rm bun.lockb
bun install
git add bun.lockb package.jsonAdd 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
*.lockb binary diff=lockb
# .git/config
[diff "lockb"]
textconv = bunHow 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.