vitest-dev/vitest · error · Error

Blob reporter is not supported in watch mode

Error message

Blob reporter is not supported in watch mode

What it means

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.

Source

Thrown at packages/vitest/src/node/reporters/blob.ts:32

export interface BlobOptions {
  outputFile?: string
  label?: string
}

export class BlobReporter implements Reporter {
  start = 0
  ctx!: Vitest
  options: BlobOptions
  coverage: unknown | undefined

  constructor(options: BlobOptions) {
    this.options = options
  }

  onInit(ctx: Vitest): void {
    if (ctx.config.watch) {
      throw new Error('Blob reporter is not supported in watch mode')
    }

    this.ctx = ctx
    this.start = performance.now()
    this.coverage = undefined
  }

  onCoverage(coverage: unknown): void {
    this.coverage = coverage
  }

  async onTestRunEnd(testModules: ReadonlyArray<TestModule>, unhandledErrors: ReadonlyArray<SerializedError>): Promise<void> {
    const executionTime = performance.now() - this.start

    const files = testModules.map(testModule => testModule.task)
    const errors = [...unhandledErrors]
    const coverage = this.coverage

View on GitHub (pinned to d568f8ce37)

Solutions

  1. Drop `--watch` / set `watch: false` when running with the blob reporter.
  2. Remove `'blob'` from the reporters list for watch/interactive runs (keep it only in the CI command).
  3. Use a separate config preset or env flag to enable the blob reporter only in non-watch contexts.

Example fix

# before
vitest --watch --reporter=blob
# after
vitest --reporter=blob
Defensive patterns

Strategy: validation

Validate before calling

const usingBlob = (config.reporters ?? []).some(r =>
  Array.isArray(r) ? r[0] === 'blob' : r === 'blob',
)
if (usingBlob && config.watch) {
  throw new Error('Blob reporter cannot be used with watch mode')
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03). Data as JSON: /data/errors/776dcfe4a203202f.json. Report an issue: GitHub.