oven-sh/bun · error · Error
Expected to equal
Error message
Expected ${receivedCount[0]} to equal ${sentCount} What it means
Post-run integrity check in the postMessage object benchmark: after all benches and a 5s drain, the worker's received-message counter must equal the number of posted messages. A mismatch means messages were dropped or the worker died mid-run, invalidating the benchmark results.
Solutions
- Delete bun.lockb and run `bun install` to generate a fresh lockfile
- Upgrade Bun first so the regenerated lockfile uses the current format
- Commit the regenerated lockfile so the old format is gone for everyone
Example fix
# before $ bun install error: Outdated lockfile version # after $ rm bun.lockb && bun install
Defensive patterns
Strategy: fallback
Prevention
- Delete ancient bun.lockb files when reviving old branches instead of reusing them
- Upgrade Bun before regenerating so the new lockfile is current
- Commit the regenerated lockfile immediately so the old format disappears
When it happens
Trigger: Installing with a bun.lockb last written by a pre-1.0-era Bun (v0/v1 format) - e.g. checking out an ancient branch or importing a very old repository.
Common situations: Reviving old projects; long-lived branches that predate a Bun upgrade; archives vendored with ancient lockfiles.
Related errors
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/1743ca5829f536fc.
Report an issue: GitHub.
Appendix: source
Thrown at bench/postMessage/postMessage-object.mjs:112
worker.postMessage(objects.small);
});
bench("postMessage({ prop: " + fmt(objects.medium.property.length) + " string, ...9 more props })", async () => {
sentCount++;
worker.postMessage(objects.medium);
});
bench("postMessage({ prop: " + fmt(objects.large.property.length) + " string, ...9 more props })", async () => {
sentCount++;
worker.postMessage(objects.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)