{"id":"776dcfe4a203202f","repo":"vitest-dev/vitest","slug":"blob-reporter-is-not-supported-in-watch-mode","errorCode":null,"errorMessage":"Blob reporter is not supported in watch mode","messagePattern":"Blob reporter is not supported in watch mode","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/reporters/blob.ts","lineNumber":32,"sourceCode":"\nexport interface BlobOptions {\n  outputFile?: string\n  label?: string\n}\n\nexport class BlobReporter implements Reporter {\n  start = 0\n  ctx!: Vitest\n  options: BlobOptions\n  coverage: unknown | undefined\n\n  constructor(options: BlobOptions) {\n    this.options = options\n  }\n\n  onInit(ctx: Vitest): void {\n    if (ctx.config.watch) {\n      throw new Error('Blob reporter is not supported in watch mode')\n    }\n\n    this.ctx = ctx\n    this.start = performance.now()\n    this.coverage = undefined\n  }\n\n  onCoverage(coverage: unknown): void {\n    this.coverage = coverage\n  }\n\n  async onTestRunEnd(testModules: ReadonlyArray<TestModule>, unhandledErrors: ReadonlyArray<SerializedError>): Promise<void> {\n    const executionTime = performance.now() - this.start\n\n    const files = testModules.map(testModule => testModule.task)\n    const errors = [...unhandledErrors]\n    const coverage = this.coverage\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/reporters/blob.ts#L14-L50","documentation":"Thrown by `BlobReporter.onInit` (blob.ts:32) when the blob reporter is enabled while Vitest is running in watch mode (`ctx.config.watch === true`). The blob reporter writes a serialized snapshot of the whole test run once at the end (`onTestRunEnd`), which is incompatible with watch mode's continuous re-running, so Vitest refuses to initialize it.","triggerScenarios":"Passing `--watch` (or running `vitest --watch`) together with `--reporter=blob`; setting `watch: true` in config while listing `'blob'` in `reporters`; programmatically constructing Vitest with both `config.watch = true` and a BlobReporter instance.","commonSituations":"Copying a blob-reporter command from a CI script into a local watch session; leaving `reporters: ['blob']` in a shared config that is also used for dev/watch workflows.","solutions":["Drop `--watch` / set `watch: false` when running with the blob reporter.","Remove `'blob'` from the reporters list for watch/interactive runs (keep it only in the CI command).","Use a separate config preset or env flag to enable the blob reporter only in non-watch contexts."],"exampleFix":"# before\nvitest --watch --reporter=blob\n# after\nvitest --reporter=blob","handlingStrategy":"validation","validationCode":"const usingBlob = (config.reporters ?? []).some(r =>\n  Array.isArray(r) ? r[0] === 'blob' : r === 'blob',\n)\nif (usingBlob && config.watch) {\n  throw new Error('Blob reporter cannot be used with watch mode')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the blob reporter in CI-only configs (e.g. `vitest.config.ci.ts`).","When scripting, branch on whether watch is requested before adding the blob reporter.","Document which configs are watch-safe vs. CI-only."],"tags":["reporter","blob","watch","config"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}