vitest-dev/vitest · error · Error

provider is not supported

Error message

provider ${context.provider.name} is not supported

What it means

deleteTracing unlinks trace files using node:fs/promises unlink. After the isPlaywrightProvider branch, any other provider reaches the terminal throw. Unlike the other trace commands (which throw TypeError), this one throws a plain Error with a slightly different message. Means the cleanup path is unsupported for the active provider.

Solutions

  1. Run cleanup under `provider: 'playwright'` to match how traces were created.
  2. Disable tracing for non-playwright providers so delete commands are not emitted.
  3. Manually delete stale `__traces__/` directories if the provider has changed.
Defensive patterns

Strategy: validation

Validate before calling

const provider = 'playwright'
export default defineConfig({
  test: { browser: { provider } },
})
// cleanup of traces only happens under playwright automatically

Type guard

function supportsTracing(provider: { name: string }): boolean {
  return provider.name === 'playwright'
}

Prevention

When it happens

Trigger: deleteTracing dispatched while provider is webdriverio/preview/custom — typically because tracing was enabled then provider changed, or a non-playwright provider has trace files pending deletion.

Common situations: Provider mismatch; trace files left over from a previous playwright run now being cleaned under a different provider.

Related errors


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

Appendix: source

Thrown at packages/browser-playwright/src/commands/trace.ts:185

  }
  if (isPlaywrightProvider(context.provider)) {
    for (const trace of traces) {
      assertBrowserApiWrite(context.project, trace)
      assertBrowserFileAccess(context.project, trace)
    }
    return Promise.all(
      traces.map(trace => unlink(trace).catch((err) => {
        if (err.code === 'ENOENT') {
        // Ignore the error if the file doesn't exist
          return
        }
        // Re-throw other errors
        throw err
      })),
    )
  }

  throw new Error(`provider ${context.provider.name} is not supported`)
}

export const annotateTraces: BrowserCommand<[{ traces: string[]; testId: string }]> = async (
  { project },
  { testId, traces },
) => {
  const vitest = project.vitest
  await Promise.all(traces.map((trace) => {
    assertBrowserApiWrite(project, trace)
    assertBrowserFileAccess(project, trace)
    const entity = vitest.state.getReportedEntityById(testId)
    const location = entity?.location
      ? {
          file: entity.module.moduleId,
          line: entity.location.line,
          column: entity.location.column,
        }
      : undefined

View on GitHub (pinned to 1fa9837ec2)