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
- 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.
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
- 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.
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
- Cannot merge reports when `--reporter=blob` is used. Remove
- vitest.mergeReports() expects all paths in "${blobsDirectory
- vitest.mergeReports() expects all paths in "${blobsDirectory
- vitest.mergeReports() requires at least one blob file in "${
- vitest.mergeReports() requires all blob files to be generate
AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03).
Data as JSON: /data/errors/776dcfe4a203202f.json.
Report an issue: GitHub.