oven-sh/bun · error · Error
Expected ${receivedCount[0]} to equal ${sentCount}
Error message
Expected ${receivedCount[0]} to equal ${sentCount} What it means
The bun.lockb header declares a total buffer size larger than the bytes actually present in the file - i.e. the lockfile is truncated (src/install/lockfile/bun.lockb.rs:429-431).
Source
Thrown at bench/postMessage/postMessage-string.mjs:73
worker.postMessage(strings.small);
});
bench("postMessage(" + fmt(strings.medium.length) + " string)", async () => {
sentCount++;
worker.postMessage(strings.medium);
});
bench("postMessage(" + fmt(strings.large.length) + " string)", async () => {
sentCount++;
worker.postMessage(strings.large);
});
await run();
await new Promise(resolve => setTimeout(resolve, 5000));
if (receivedCount[0] !== sentCount) {
throw new Error("Expected " + receivedCount[0] + " to equal " + sentCount);
}
// Cleanup worker
worker?.terminate();
View on GitHub (pinned to 8c5296ac45)
Solutions
- Restore from version control: `git checkout -- bun.lockb`
- Otherwise delete bun.lockb and `bun install` to rebuild it
- Make sure installs complete and the disk has space before saving
Defensive patterns
Strategy: fallback
Prevention
- Let installs finish; avoid killing `bun install` while it saves the lockfile
- Keep disk headroom so lockfile writes never truncate
- If git LFS is in play, exclude bun.lockb from it
When it happens
Trigger: An install was killed or crashed while rewriting bun.lockb; disk filled mid-save; a partial checkout/clone; git LFS or transfer mangling shortening the file.
Common situations: CI cancelled mid-install; laptops sleeping/crashing during install; incomplete git operations on the binary lockfile.
Related errors
- not 200
- size mismatch
- picsum ${p.id}: ${res.status}
- Invalid data object: ${JSON.stringify(data)}
- ${runtime} server exited before READY
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/b3220984903ecc7e.
Report an issue: GitHub.