microsoft/playwright · error · Error

Cannot save zipped HAR in thin clients

Error message

Cannot save zipped HAR in thin clients

What it means

Error "Cannot save zipped HAR in thin clients" thrown in microsoft/playwright.

Source

Thrown at packages/playwright-core/src/client/tracing.ts:164

  }

  async _exportHAR(harId: string): Promise<void> {
    const harParams = this._harRecorders.get(harId);
    if (!harParams)
      return;
    this._harRecorders.delete(harId);
    const isLocal = !this._connection.isRemote();
    const isZip = harParams.path.endsWith('.zip');

    if (isLocal) {
      const { entries } = await this._channel.harExport({ harId, mode: 'entries' }, kNoTimeout);
      if (!isZip) {
        // Server wrote HAR and resources to the user's chosen paths.
        return;
      }
      const localUtils = this._connection.localUtils();
      if (!localUtils)
        throw new Error('Cannot save zipped HAR in thin clients');
      await localUtils.zip({ zipFile: harParams.path, entries: entries!, mode: 'write', includeSources: false, additionalSources: [] });
      return;
    }

    const { artifact: artifactChannel } = await this._channel.harExport({ harId, mode: 'archive' }, kNoTimeout);
    const artifact = Artifact.from(artifactChannel!);
    if (isZip) {
      await artifact.saveAs(harParams.path);
      await artifact.delete();
      return;
    }
    const localUtils = this._connection.localUtils();
    if (!localUtils)
      throw new Error('Uncompressed har is not supported in thin clients');
    await artifact.saveAs(harParams.path + '.tmp');
    await localUtils.harUnzip({ zipFile: harParams.path + '.tmp', harFile: harParams.path, resourcesDir: harParams.resourcesDir });
    await artifact.delete();
  }

View on GitHub (pinned to c8fc3bf8d3)

When it happens

Trigger: Thrown at packages/playwright-core/src/client/tracing.ts:164 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/92ce92897cba056b. Report an issue: GitHub.