vitest-dev/vitest · error · Error
vitest.mergeReports() requires all blob files to be…
Error message
vitest.mergeReports() requires all blob files to be generated by the same Vitest version, received
${blobs.map(b => `- "${b.file}" uses v${b.version}`).join('\n')} What it means
All individual blob files are valid, but they were produced by different Vitest versions (the version is stored as the first element of each blob). Because the serialized module-graph and report shape are version-sensitive, merging across versions is rejected. The error lists each blob with its version.
Solutions
- Regenerate every blob with the same Vitest version (align all `@vitest/*` packages and re-run all shards).
- Clear the blobs directory before re-running so no stale-version blobs remain.
- Verify version alignment with `pnpm why vitest` / `pnpm list vitest` across the workspace.
Example fix
# before: stale v2 blob mixed with v3 blob in ./blobs vitest --merge-reports=./blobs # error: multiple versions # after clear-dir ./blobs # re-run every shard on the same vitest version vitest --run --reporter=blob # v3.x across all shards vitest --merge-reports=./blobs
Defensive patterns
Strategy: validation
Validate before calling
import { readdir, readFile } from 'node:fs/promises'
import { parse } from 'flatted'
async function assertAllBlobsSameVersion(dir: string) {
const versions = new Set<string>()
for (const name of await readdir(dir)) {
const [v] = parse(await readFile(resolve(dir, name), 'utf-8')) as [string, ...unknown[]]
versions.add(v)
}
if (versions.size > 1) {
throw new Error(`Blobs in '${dir}' were produced by multiple Vitest versions: ${[...versions].join(', ')}. Regenerate all on the same version.`)
}
} Prevention
- Pin a single Vitest version across every shard that writes blobs.
- Clear the blobs directory after upgrading Vitest before producing new blobs.
When it happens
Trigger: Two or more shards wrote blobs into the same directory while running different Vitest versions, so `new Set(blobs.map(b => b.version)).size > 1`.
Common situations: Upgrading Vitest between CI runs and stale blobs remaining; mixed local/CI versions; some shards pinned to an old `@vitest/*` while others updated.
Related errors
- the blobs in " " were generated by a different version of…
- vitest.mergeReports() expects all paths in
- vitest.mergeReports() expects all paths in
- vitest.mergeReports() requires at least one blob file in
- Blob reporter is not supported in watch mode
AI-assisted analysis of vitest-dev/vitest@1fa9837ec2 (2026-08-11).
Data as JSON: /api/errors/d17b741d8f6c2c85.
Report an issue: GitHub.
Appendix: source
Thrown at packages/vitest/src/node/reporters/blob.ts:150
) as MergeReport
if (!version) {
throw new TypeError(
`vitest.mergeReports() expects all paths in "${blobsDirectory}" to be files generated by the blob reporter, but "${filename}" is not a valid blob file`,
)
}
return { version, files, errors, coverage, file: filename, executionTime, environmentModules }
})
const blobs = await Promise.all(promises)
if (!blobs.length) {
throw new Error(
`vitest.mergeReports() requires at least one blob file in "${blobsDirectory}" directory, but none were found`,
)
}
const versions = new Set(blobs.map(blob => blob.version))
if (versions.size > 1) {
throw new Error(
`vitest.mergeReports() requires all blob files to be generated by the same Vitest version, received\n\n${blobs.map(b => `- "${b.file}" uses v${b.version}`).join('\n')}`,
)
}
if (!versions.has(currentVersion)) {
throw new Error(
`the blobs in "${blobsDirectory}" were generated by a different version of Vitest. Expected v${currentVersion}, but received v${blobs[0].version}`,
)
}
// Restore module graph
const projects = Object.fromEntries(
projectsArray.map(p => [p.name, p]),
)
blobs.forEach((blob) => {
Object.entries(blob.environmentModules).forEach(([projectName, modulesByProject]) => {
const project = projects[projectName]View on GitHub (pinned to 1fa9837ec2)