vitest-dev/vitest · error · TypeError
The ${context.provider.name} provider does not support traci
Error message
The ${context.provider.name} provider does not support tracing. What it means
Thrown as a TypeError by the stopChunkTrace browser command when the provider is not Playwright. stopChunkTrace calls context.context.tracing.stopChunk to finalize and write the trace.zip; only Playwright exposes this API.
Source
Thrown at packages/browser-playwright/src/commands/trace.ts:62
await context.tracing.startChunk({ name, title })
return
}
throw new TypeError(`The ${provider.name} provider does not support tracing.`)
}
export const stopChunkTrace: BrowserCommand<[{ name: string }]> = async (
context,
{ name },
) => {
if (isPlaywrightProvider(context.provider)) {
const path = resolveTracesPath(context, name)
assertBrowserApiWrite(context.project, path)
assertBrowserFileAccess(context.project, path)
context.provider.pendingTraces.delete(path)
await context.context.tracing.stopChunk({ path })
return { tracePath: path }
}
throw new TypeError(`The ${context.provider.name} provider does not support tracing.`)
}
export const markTrace: BrowserCommand<[payload: { name: string; element?: SerializedLocator; stack?: string }]> = async (
context,
payload,
) => {
if (isPlaywrightProvider(context.provider)) {
// skip if tracing is not active
// this is only safe guard and this isn't expected to happen since
// runner already checks if tracing is active before sending this command
if (!context.provider.tracingContexts.has(context.sessionId)) {
return
}
const { name, element, stack } = payload
const location = parseLocation(context, stack)
// mark trace via group/groupEnd with dummy calls to force snapshot.
// https://github.com/microsoft/playwright/issues/39308
await context.context.tracing.group(name, { location })View on GitHub (pinned to d568f8ce37)
Solutions
- Run the affected tests under provider 'playwright'.
- Disable browser.trace for non-playwright providers.
- Ensure startChunkTrace and stopChunkTrace are only dispatched in playwright runs.
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(`stopChunkTrace needs playwright, got ${context.provider.name}`)
}
await stopChunkTrace(context, { name }) Type guard
function isPlaywright(p: BrowserProvider): p is PlaywrightBrowserProvider {
return p.name === 'playwright'
} Prevention
- Keep startChunkTrace and stopChunkTrace paired within playwright runs.
- Disable tracing when switching to webdriverio/preview.
- Make trace config conditional on provider.
When it happens
Trigger: The runner dispatches stopChunkTrace against a webdriverio or preview provider, e.g. because trace was enabled globally while the active provider lacks tracing support.
Common situations: Provider mismatch in shared configs, or partial teardown that calls stopChunkTrace after a provider swap mid-run.
Related errors
- The ${provider.name} provider does not support tracing.
- stopChunkTrace cannot be called outside of the test file.
- This command can only be called inside a test file.
- provider ${context.provider.name} is not supported
- Cannot take a screenshot without a test path
AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03).
Data as JSON: /data/errors/99093428f7e597d2.json.
Report an issue: GitHub.