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

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.

Solutions

  1. Force a single run with `--run` (or `watch: false`) whenever the blob reporter is enabled.
  2. Enable the blob reporter conditionally only outside watch mode, e.g. `reporters: process.env.CI ? ['blob'] : ['default']`.
  3. Drop the blob reporter from your watch-mode config.

Example fix

// before
export default defineConfig({
  test: { watch: true, reporters: ['blob'] },
})

// after
export default defineConfig({
  test: {
    watch: false,
    reporters: process.env.CI ? ['blob'] : ['default'],
  },
})
Defensive patterns

Strategy: validation

Validate before calling

function assertBlobNotInWatch(config: { watch?: boolean; reporters: unknown[] }) {
  const hasBlob = config.reporters.some(r =>
    Array.isArray(r) ? r[0] === 'blob' : r === 'blob',
  )
  if (hasBlob && config.watch) {
    throw new Error('Blob reporter cannot be used in watch mode. Pass --run or set watch: false.')
  }
}

Prevention

When it happens

Trigger: `reporters: [['blob', {...}]]` (or `'blob'` shorthand) together with `--watch` on the CLI or `watch: true` in config.

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

Related errors


AI-assisted analysis of vitest-dev/vitest@1fa9837ec2 (2026-08-11). Data as JSON: /api/errors/776dcfe4a203202f. Report an issue: GitHub.

Appendix: 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 1fa9837ec2)