vitest-dev/vitest · error · Error

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

Error message

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

What it means

Thrown as a generic Error (note: lowercase 'provider' and Error, not TypeError, unlike the other trace guards) by deleteTracing when the provider is not Playwright. deleteTracing only knows how to unlink Playwright-produced trace artifacts for the session; for other providers there is no trace set to delete.

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 d568f8ce37)

Solutions

  1. Use provider 'playwright' when tracing is enabled.
  2. Disable browser.trace for webdriverio/preview so deleteTracing is not dispatched.
  3. Guard any custom deleteTracing call on provider name === 'playwright'.

Example fix

// before
test: { browser: { provider: 'webdriverio', trace: { enabled: true } } }

// after
test: { browser: { provider: 'playwright', trace: { enabled: true } } }
Defensive patterns

Strategy: validation

Validate before calling

if (context.provider.name !== 'playwright') {
  throw new Error(`deleteTracing needs playwright, got ${context.provider.name}`)
}
await deleteTracing(context, { traces })

Type guard

function isPlaywright(p: BrowserProvider): p is PlaywrightBrowserProvider {
  return p.name === 'playwright'
}

Prevention

When it happens

Trigger: The runner dispatches deleteTracing under webdriverio or preview because trace config was enabled for a non-playwright provider, hitting the fall-through throw.

Common situations: Trace enabled on a non-playwright provider; cleanup hook that unconditionally calls deleteTracing across a provider matrix.

Related errors


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