{"record":{"id":"1d882e783df9da10","repo":"vitest-dev/vitest","slug":"vitest-mergereports-requires-at-least-one-blob-f","errorCode":null,"errorMessage":"vitest.mergeReports() requires at least one blob file in \"${blobsDirectory}\" directory, but none were found","messagePattern":"vitest\\.mergeReports\\(\\) requires at least one blob file in \"(.+?)\" directory, but none were found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/reporters/blob.ts","lineNumber":143,"sourceCode":"      throw new TypeError(\n        `vitest.mergeReports() expects all paths in \"${blobsDirectory}\" to be files generated by the blob reporter, but \"${filename}\" is not a file`,\n      )\n    }\n    const content = await readFile(fullPath, 'utf-8')\n    const [version, files, errors, coverage, executionTime, environmentModules] = parse(\n      content,\n    ) as MergeReport\n    if (!version) {\n      throw new TypeError(\n        `vitest.mergeReports() expects all paths in \"${blobsDirectory}\" to be files generated by the blob reporter, but \"${filename}\" is not a valid blob file`,\n      )\n    }\n    return { version, files, errors, coverage, file: filename, executionTime, environmentModules }\n  })\n  const blobs = await Promise.all(promises)\n\n  if (!blobs.length) {\n    throw new Error(\n      `vitest.mergeReports() requires at least one blob file in \"${blobsDirectory}\" directory, but none were found`,\n    )\n  }\n\n  const versions = new Set(blobs.map(blob => blob.version))\n  if (versions.size > 1) {\n    throw new Error(\n      `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')}`,\n    )\n  }\n\n  if (!versions.has(currentVersion)) {\n    throw new Error(\n      `the blobs in \"${blobsDirectory}\" were generated by a different version of Vitest. Expected v${currentVersion}, but received v${blobs[0].version}`,\n    )\n  }\n\n  // Restore module graph","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/vitest-dev/vitest/blob/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/reporters/blob.ts#L125-L161","documentation":"The blobs directory exists and is readable but `readdir` returned zero entries, so there is nothing to merge. Vitest throws rather than producing an empty merged report.","triggerScenarios":"Calling `vitest --merge-reports ./empty-dir` (or `vitest.mergeReports(version, './empty-dir', projects)`) before any blob has been written.","commonSituations":"Forgot to run tests with the blob reporter first; wrong directory path; the output dir was cleaned between the generate and merge steps; glob/outputFile misconfiguration wrote blobs elsewhere.","solutions":["Generate blobs first: run tests with `reporters: ['blob']` and `--run`.","Confirm the directory path matches where `BlobReporter.onTestRunEnd` actually wrote (it logs `blob report written to <path>`).","Check shard config: each shard must write its own blob into the same directory."],"exampleFix":"# before: merging an empty dir\nvitest --merge-reports=./blobs   # error: no blob files\n\n# after: generate first, then merge\nvitest --run --reporter=blob\nvitest --merge-reports=./blobs","handlingStrategy":"validation","validationCode":"import { readdir } from 'node:fs/promises'\nasync function assertBlobsDirNonEmpty(dir: string) {\n  const entries = await readdir(dir)\n  if (entries.length === 0) {\n    throw new Error(`No blob files in '${dir}'. Run tests with reporters: ['blob'] and --run first.`)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run the blob-reporter generate step before `--merge-reports`.","Confirm the generate step's logged output path equals the merge path."],"tags":["reporter","blob","merge"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}