{"record":{"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":"exception","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/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/reporters/blob.ts#L14-L50","documentation":"The blob reporter serializes a complete snapshot of the test run exactly once at the end of a run. Watch mode runs continuously with no terminal point, so combining them is undefined; `BlobReporter.onInit` refuses to initialize when `ctx.config.watch` is true.","triggerScenarios":"`reporters: [['blob', {...}]]` (or `'blob'` shorthand) together with `--watch` on the CLI or `watch: true` in config.","commonSituations":"A shared config that enables the blob reporter for CI but also defaults to watch in local dev; running `vitest` (which defaults to watch when not in CI) with blob in the reporters list.","solutions":["Force a single run with `--run` (or `watch: false`) whenever the blob reporter is enabled.","Enable the blob reporter conditionally only outside watch mode, e.g. `reporters: process.env.CI ? ['blob'] : ['default']`.","Drop the blob reporter from your watch-mode config."],"exampleFix":"// before\nexport default defineConfig({\n  test: { watch: true, reporters: ['blob'] },\n})\n\n// after\nexport default defineConfig({\n  test: {\n    watch: false,\n    reporters: process.env.CI ? ['blob'] : ['default'],\n  },\n})","handlingStrategy":"validation","validationCode":"function assertBlobNotInWatch(config: { watch?: boolean; reporters: unknown[] }) {\n  const hasBlob = config.reporters.some(r =>\n    Array.isArray(r) ? r[0] === 'blob' : r === 'blob',\n  )\n  if (hasBlob && config.watch) {\n    throw new Error('Blob reporter cannot be used in watch mode. Pass --run or set watch: false.')\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate the blob reporter behind a CI flag so watch mode never picks it up.","Default to `watch: false` in configs shared between CI and local dev."],"tags":["reporter","blob","watch"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}