oven-sh/bun · error · Error

Expected ${receivedCount[0]} to equal ${sentCount}

Error message

Expected ${receivedCount[0]} to equal ${sentCount}

What it means

The binary bun.lockb predates the oldest format Bun can migrate: only v2 is auto-migrated to the current format; anything older is rejected (src/install/lockfile/bun.lockb.rs:415-418).

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)

Solutions

  1. Delete bun.lockb and run `bun install` to generate a fresh lockfile
  2. Upgrade Bun first so the regenerated lockfile uses the current format
  3. 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

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.