{"id":"12c142f28a98c33b","repo":"vitest-dev/vitest","slug":"cannot-merge-reports-when-reporter-blob-is-use","errorCode":null,"errorMessage":"Cannot merge reports when `--reporter=blob` is used. Remove blob reporter from the config first.","messagePattern":"Cannot merge reports when `--reporter=blob` is used\\. Remove blob reporter from the config first\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/core.ts","lineNumber":677,"sourceCode":"    return this._coverageProvider\n  }\n\n  /**\n   * Deletes all Vitest caches, including the `fsModuleCache`.\n   * @experimental\n   */\n  public async experimental_clearCache(): Promise<void> {\n    await this.cache.results.clearCache()\n    await this._fsCache.clearCache()\n  }\n\n  /**\n   * Merge reports from multiple runs located in the specified directory (value from `--merge-reports` if not specified).\n   */\n  public async mergeReports(directory?: string): Promise<TestRunResult> {\n    return this._traces.$('vitest.merge_reports', async () => {\n      if (this.reporters.some(r => r instanceof BlobReporter)) {\n        throw new Error('Cannot merge reports when `--reporter=blob` is used. Remove blob reporter from the config first.')\n      }\n\n      const { files, errors, coverages, executionTimes, transformTimes } = await readBlobs(this.version, directory || this.config.mergeReports, this.projects)\n      this.state.blobs = { files, errors, coverages, executionTimes, transformTimes }\n      this.state.transformTime = transformTimes.reduce((a, b) => a + b, 0)\n\n      await this.report('onInit', this)\n\n      const specifications: TestSpecification[] = []\n      for (const file of files) {\n        const project = this.getProjectByName(file.projectName || '')\n        const specification = project.createSpecification(file.filepath, undefined, file.pool, file.id)\n        specifications.push(specification)\n      }\n\n      await this._testRun.start(specifications)\n      await this.coverageProvider?.onTestRunStart?.()\n","sourceCodeStart":659,"sourceCodeEnd":695,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/core.ts#L659-L695","documentation":"Vitest.mergeReports() (core.ts:677) refuses to run while a BlobReporter is in the active reporters list. The blob reporter's job is to write blob files; mergeReports' job is to read them back — doing both in one process is contradictory, so vitest prevents it.","triggerScenarios":"Invoking vitest.mergeReports() (or the CLI --merge-reports flow) while the config or CLI still enables reporter: 'blob' / reporter: [['blob', options]].","commonSituations":"CI pipelines that reuse the same vitest config for both producing and merging blobs; forgetting to remove 'blob' from the reporters array before the merge step.","solutions":["Remove the blob reporter from config/CLI for the merge run (use only the merge-report consumer).","Split into two invocations: one with --reporter=blob to produce blobs, a separate one with --merge-reports to consume them.","Use distinct config files or CLI overrides for the produce vs. merge phases."],"exampleFix":"// vitest.config.ts (merge step)\n// before\ntest: { reporters: ['blob', 'default'] }\n\n// after (merge-only run)\ntest: { reporters: ['default'] }\n// invoke: vitest --merge-reports","handlingStrategy":"validation","validationCode":"const hasBlob = vitest.reporters.some(r => r instanceof BlobReporter)\nif (hasBlob) {\n  throw new Error('Remove blob reporter before merging reports')\n}\nawait vitest.mergeReports(dir)","typeGuard":"function isBlobReporter(r: any): boolean {\n  return r?.constructor?.name === 'BlobReporter'\n}","tryCatchPattern":null,"preventionTips":["Use separate CLI invocations/configs for producing vs merging blobs.","Never list 'blob' in reporters for the --merge-reports run.","Document the produce/consume split in CI pipeline docs."],"tags":["reporters","blob","merge","config"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}