vitest-dev/vitest · error · Error

vitest.mergeReports() requires at least one blob file in "${

Error message

vitest.mergeReports() requires at least one blob file in "${blobsDirectory}" directory, but none were found

What it means

Thrown by `readBlobs` (blob.ts:144) when the `--merge-reports` directory exists and `readdir` succeeds but returns zero entries (`blobs.length === 0`). Merging requires at least one blob file to have anything to report, so an empty directory is treated as a user error rather than silently producing an empty result.

Source

Thrown at packages/vitest/src/node/reporters/blob.ts:144

      throw new TypeError(
        `vitest.mergeReports() expects all paths in "${blobsDirectory}" to be files generated by the blob reporter, but "${filename}" is not a file`,
      )
    }
    const content = await readFile(fullPath, 'utf-8')
    const [version, files, errors, coverage, executionTime, environmentModules, transformTime] = parse(
      content,
    ) 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, transformTime }
  })
  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

View on GitHub (pinned to d568f8ce37)

Solutions

  1. Run the test suite(s) with `--reporter=blob` first so blob files are actually written into the directory.
  2. Verify the directory path passed to `--merge-reports` is the one the blob reporter wrote to.
  3. Check that no cleanup step removed the blob files between the write and merge steps.

Example fix

# before
vitest --merge-reports ./empty-dir
# after
vitest --reporter=blob   # writes blob files first
vitest --merge-reports ./blob-reports
Defensive patterns

Strategy: validation

Validate before calling

import { readdirSync } from 'node:fs'
if (readdirSync(blobsDirectory).length === 0) {
  throw new Error('No blob files to merge; run with --reporter=blob first')
}

Prevention

When it happens

Trigger: Running `vitest --merge-reports <dir>` against an empty directory; pointing at a directory where blob files were already cleaned up; mistyping the path so it resolves to an unrelated empty folder.

Common situations: Forgetting to run the blob-reporter pass before the merge pass; CI pipeline ordering bug that merges before any shard has written its blob; path typos.

Related errors


AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03). Data as JSON: /data/errors/1d882e783df9da10.json. Report an issue: GitHub.