microsoft/playwright · error · Error
resourcesDir option is not compatible with a .zip har file
Error message
resourcesDir option is not compatible with a .zip har file
What it means
Error "resourcesDir option is not compatible with a .zip har file" thrown in microsoft/playwright.
Source
Thrown at packages/playwright-core/src/client/tracing.ts:108
async stopChunk(options: { path?: string } = {}) {
await this._wrapApiCall(async () => {
await this._doStopChunk(options.path);
});
}
async stop(options: { path?: string } = {}) {
await this._wrapApiCall(async () => {
await this._doStopChunk(options.path);
await this._channel.tracingStop({}, kNoTimeout);
});
}
async startHar(path: string, options: { content?: 'embed' | 'attach' | 'omit', mode?: 'full' | 'minimal', urlFilter?: string | RegExp, resourcesDir?: string } = {}) {
await this._wrapApiCall(async () => {
if (this._harId)
throw new Error('HAR recording has already been started');
if (options.resourcesDir && path.endsWith('.zip'))
throw new Error('resourcesDir option is not compatible with a .zip har file');
const defaultContent = path.endsWith('.zip') ? 'attach' : 'embed';
this._harId = await this._recordIntoHAR(path, null, {
url: options.urlFilter,
updateContent: options.content ?? defaultContent,
updateMode: options.mode ?? 'full',
resourcesDir: options.resourcesDir,
});
});
return new DisposableStub(() => this.stopHar());
}
async stopHar() {
await this._wrapApiCall(async () => {
const harId = this._harId;
if (!harId)
throw new Error('HAR recording has not been started');
this._harId = undefined;
await this._exportHAR(harId);View on GitHub (pinned to c8fc3bf8d3)
When it happens
Trigger: Thrown at packages/playwright-core/src/client/tracing.ts:108 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12).
Data as JSON: /api/errors/fed3b1a704dfe767.
Report an issue: GitHub.