{"record":{"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/1fa9837ec26533512fdcad8baebf249771bd340a/packages/browser-playwright/src/commands/trace.ts#L9-L45","documentation":"Tracing in Vitest browser mode is implemented exclusively on the Playwright provider via `context.tracing.*`. startTracing guards with isPlaywrightProvider(provider) and throws a TypeError for any other provider name (e.g. webdriverio, preview). The trace config exists but only the playwright provider wires it to Playwright's tracing engine.","triggerScenarios":"Configuring `browser.trace` and running with `provider: 'webdriverio'` or a custom/third-party provider while startTracing is invoked (typically automatically by the runner at test start).","commonSituations":"Switching provider from playwright to webdriverio without disabling tracing; using the preview provider with tracing enabled; writing a custom provider that does not implement tracing.","solutions":["Set `provider: 'playwright'` in the browser project config when you need traces.","Disable tracing if you must use webdriverio/preview: `browser: { trace: false }` or omit trace config.","If authoring a custom provider, implement tracing by extending the Playwright provider or document that tracing is unsupported and ensure the runner does not call startTracing."],"exampleFix":"// before\nexport default defineConfig({\n  test: { browser: { provider: 'webdriverio', trace: { screenshots: true } } },\n})\n\n// after\nexport default defineConfig({\n  test: { browser: { provider: 'playwright', trace: { screenshots: true } } },\n})","handlingStrategy":"validation","validationCode":"// in vitest.config — only enable trace for the playwright project\nconst useTrace = process.env.BROWSER_PROVIDER === 'playwright'\nexport default defineConfig({\n  test: {\n    projects: [{\n      test: {\n        name: 'browser',\n        browser: { provider: 'playwright', trace: useTrace ? 'on' : 'off' },\n      },\n    }],\n  },\n})","typeGuard":"import type { BrowserProvider } from 'vitest/node'\n\nfunction supportsTracing(provider: BrowserProvider): boolean {\n  return provider.name === 'playwright'\n}","tryCatchPattern":null,"preventionTips":["Treat tracing as a playwright-only feature; do not enable it for webdriverio/preview.","Keep provider and trace config in one place so they stay in sync.","Document per-project which provider is used so trace config is not copied blindly."],"tags":["browser","tracing","provider","playwright","config"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}