{"id":"47a6eb7a337f6a5d","repo":"vitest-dev/vitest","slug":"the-provider-name-provider-does-not-support-tra","errorCode":null,"errorMessage":"The ${provider.name} provider does not support tracing.","messagePattern":"The (.+?) provider does not support tracing\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/browser-playwright/src/commands/trace.ts","lineNumber":27,"sourceCode":"\nexport const startTracing: BrowserCommand<[]> = async ({ context, project, provider, sessionId }) => {\n  if (isPlaywrightProvider(provider)) {\n    if (provider.tracingContexts.has(sessionId)) {\n      return\n    }\n\n    provider.tracingContexts.add(sessionId)\n    const options = project.config.browser!.trace\n    await context.tracing.start({\n      screenshots: options.screenshots ?? true,\n      snapshots: options.snapshots ?? true,\n      sources: options.sources ?? true,\n    }).catch(() => {\n      provider.tracingContexts.delete(sessionId)\n    })\n    return\n  }\n  throw new TypeError(`The ${provider.name} provider does not support tracing.`)\n}\n\nexport const startChunkTrace: BrowserCommand<[{ name: string; title: string }]> = async (\n  command,\n  { name, title },\n) => {\n  const { provider, sessionId, testPath, context } = command\n  if (!testPath) {\n    throw new Error(`stopChunkTrace cannot be called outside of the test file.`)\n  }\n  if (isPlaywrightProvider(provider)) {\n    if (!provider.tracingContexts.has(sessionId)) {\n      await startTracing(command)\n    }\n    const path = resolveTracesPath(command, name)\n    provider.pendingTraces.set(path, sessionId)\n    await context.tracing.startChunk({ name, title })\n    return","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/browser-playwright/src/commands/trace.ts#L9-L45","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set browser.provider to 'playwright' if you need tracing.","Disable tracing for other providers: browser.trace = { enabled: false }.","Guard tracing enablement on the provider name in your vitest config."],"exampleFix":"// before\nexport default defineConfig({\n  test: { browser: { provider: 'webdriverio', trace: { enabled: true } } },\n})\n\n// after\nexport default defineConfig({\n  test: { browser: { provider: 'playwright', trace: { enabled: true } } },\n})","handlingStrategy":"validation","validationCode":"if (context.provider.name !== 'playwright') {\n  throw new Error(`tracing requires playwright provider, got ${context.provider.name}`)\n}\nawait startTracing(context)","typeGuard":"function isPlaywright(p: BrowserProvider): p is PlaywrightBrowserProvider {\n  return p.name === 'playwright'\n}","tryCatchPattern":null,"preventionTips":["Only enable browser.trace under provider 'playwright'.","Make trace config conditional on provider in vitest.config.","Document that webdriverio/preview cannot trace."],"tags":["browser","playwright","tracing","provider","webdriverio","vitest"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}