vitest-dev/vitest · error · TypeError

The ${provider.name} provider does not support tracing.

Error message

The ${provider.name} provider does not support tracing.

What it means

Thrown as a TypeError by the startTracing browser command when the active provider is not Playwright. Vitest's tracing (trace.zip capture, markTrace, groupTrace) is implemented exclusively on Playwright's tracing API; webdriverio and the built-in preview provider have no equivalent.

Source

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

export const startTracing: BrowserCommand<[]> = async ({ context, project, provider, sessionId }) => {
  if (isPlaywrightProvider(provider)) {
    if (provider.tracingContexts.has(sessionId)) {
      return
    }

    provider.tracingContexts.add(sessionId)
    const options = project.config.browser!.trace
    await context.tracing.start({
      screenshots: options.screenshots ?? true,
      snapshots: options.snapshots ?? true,
      sources: options.sources ?? true,
    }).catch(() => {
      provider.tracingContexts.delete(sessionId)
    })
    return
  }
  throw new TypeError(`The ${provider.name} provider does not support tracing.`)
}

export const startChunkTrace: BrowserCommand<[{ name: string; title: string }]> = async (
  command,
  { name, title },
) => {
  const { provider, sessionId, testPath, context } = command
  if (!testPath) {
    throw new Error(`stopChunkTrace cannot be called outside of the test file.`)
  }
  if (isPlaywrightProvider(provider)) {
    if (!provider.tracingContexts.has(sessionId)) {
      await startTracing(command)
    }
    const path = resolveTracesPath(command, name)
    provider.pendingTraces.set(path, sessionId)
    await context.tracing.startChunk({ name, title })
    return

View on GitHub (pinned to d568f8ce37)

Solutions

  1. Set browser.provider to 'playwright' if you need tracing.
  2. Disable tracing for other providers: browser.trace = { enabled: false }.
  3. Guard tracing enablement on the provider name in your vitest config.

Example fix

// before
export default defineConfig({
  test: { browser: { provider: 'webdriverio', trace: { enabled: true } } },
})

// after
export default defineConfig({
  test: { browser: { provider: 'playwright', trace: { enabled: true } } },
})
Defensive patterns

Strategy: validation

Validate before calling

if (context.provider.name !== 'playwright') {
  throw new Error(`tracing requires playwright provider, got ${context.provider.name}`)
}
await startTracing(context)

Type guard

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

Prevention

When it happens

Trigger: Enabling browser.trace in config while using provider 'preview' or 'webdriverio', which routes startTracing to the non-playwright branch and throws. Also triggered by manually dispatching the __vitest_startTracing command against a non-playwright provider.

Common situations: Setting `browser: { provider: 'webdriverio', trace: { enabled: true } }`, or leaving trace defaults on after switching providers. CI configs that worked under playwright then flipped to webdriverio.

Related errors


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