vitest-dev/vitest · error

Cannot merge reports when `--reporter=blob` is used. Remove…

Error message

Cannot merge reports when `--reporter=blob` is used. Remove blob reporter from the config first.

What it means

mergeReports refuses to run while a BlobReporter is active because blob reports are the INPUT to a merge, not its output; writing blobs while reading them would corrupt the merged result. The check scans this.reporters for any BlobReporter instance and aborts. You must remove the blob reporter from the config or CLI before merging.

Solutions

  1. Remove reporter: ['blob'] (and --reporter=blob) from the config/CLI used for the merge run.
  2. Run the merge as a separate command/process without the blob reporter.
  3. Conditionally enable blob reporter only on the sharded test runs, not the merge run.

Example fix

// before
const vitest = await createVitest('test', { reporters: ['blob'], mergeReports: './blobs' })
await vitest.mergeReports()

// after
const vitest = await createVitest('test', { reporters: ['default'], mergeReports: './blobs' })
await vitest.mergeReports()
Defensive patterns

Strategy: validation

Validate before calling

import { BlobReporter } from 'vitest/node'
function hasBlobReporter(reporters) {
  return reporters.some(r => r instanceof BlobReporter)
}
// before merge: if (hasBlobReporter(vitest.reporters)) strip blob reporter from config and recreate

Try / catch

try {
  await vitest.mergeReports()
} catch (e) {
  if (/blob reporter/i.test(e.message)) {
    // rebuild vitest without reporter:'blob', then retry merge
  } else throw e
}

Prevention

When it happens

Trigger: Calling vitest.mergeReports() (or running with --merge-reports) while --reporter=blob is set in config, CLI args, or programmatic options, so this.reporters contains a BlobReporter.

Common situations: CI pipelines that always set reporter: ['blob'] then run a merge step in the same job; copy-pasted config combining blob and merge-reports; programmatic API reuse with shared options.

Related errors


AI-assisted analysis of vitest-dev/vitest@1fa9837ec2 (2026-08-11). Data as JSON: /api/errors/12c142f28a98c33b. Report an issue: GitHub.

Appendix: source

Thrown at packages/vitest/src/node/core.ts:676

    return this._coverageProvider
  }

  /**
   * Deletes all Vitest caches, including the `fsModuleCache`.
   * @experimental
   */
  public async experimental_clearCache(): Promise<void> {
    await this.cache.results.clearCache()
    await this._fsCache.clearCache()
  }

  /**
   * Merge reports from multiple runs located in the specified directory (value from `--merge-reports` if not specified).
   */
  public async mergeReports(directory?: string): Promise<TestRunResult> {
    return this._traces.$('vitest.merge_reports', async () => {
      if (this.reporters.some(r => r instanceof BlobReporter)) {
        throw new Error('Cannot merge reports when `--reporter=blob` is used. Remove blob reporter from the config first.')
      }

      const { files, errors, coverages, executionTimes } = await readBlobs(this.version, directory || this.config.mergeReports, this.projects)
      this.state.blobs = { files, errors, coverages, executionTimes }

      await this.report('onInit', this)

      const specifications: TestSpecification[] = []
      for (const file of files) {
        const project = this.getProjectByName(file.projectName || '')
        const specification = project.createSpecification(file.filepath, undefined, file.pool, file.id)
        specifications.push(specification)
      }

      await this._testRun.start(specifications)
      await this.coverageProvider?.onTestRunStart?.()

      for (const file of files) {

View on GitHub (pinned to 1fa9837ec2)