vitest-dev/vitest · error · Error
provider is not supported
Error message
provider ${context.provider.name} is not supported What it means
deleteTracing unlinks trace files using node:fs/promises unlink. After the isPlaywrightProvider branch, any other provider reaches the terminal throw. Unlike the other trace commands (which throw TypeError), this one throws a plain Error with a slightly different message. Means the cleanup path is unsupported for the active provider.
Solutions
- Run cleanup under `provider: 'playwright'` to match how traces were created.
- Disable tracing for non-playwright providers so delete commands are not emitted.
- Manually delete stale `__traces__/` directories if the provider has changed.
Defensive patterns
Strategy: validation
Validate before calling
const provider = 'playwright'
export default defineConfig({
test: { browser: { provider } },
})
// cleanup of traces only happens under playwright automatically Type guard
function supportsTracing(provider: { name: string }): boolean {
return provider.name === 'playwright'
} Prevention
- Create and clean traces under the same (playwright) provider.
- Disable tracing for non-playwright providers.
- Manually clear stale __traces__ directories after switching providers.
When it happens
Trigger: deleteTracing dispatched while provider is webdriverio/preview/custom — typically because tracing was enabled then provider changed, or a non-playwright provider has trace files pending deletion.
Common situations: Provider mismatch; trace files left over from a previous playwright run now being cleaned under a different provider.
Related errors
- This command can only be called inside a test file.
- stopChunkTrace cannot be called outside of the test file.
- The provider does not support tracing.
- The provider does not support tracing.
- Access denied to " ". See Vite config documentation for…
AI-assisted analysis of vitest-dev/vitest@1fa9837ec2 (2026-08-11).
Data as JSON: /api/errors/63eee6deaf416a5b.
Report an issue: GitHub.
Appendix: 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,
}
: undefinedView on GitHub (pinned to 1fa9837ec2)