{"record":{"id":"92ce92897cba056b","repo":"microsoft/playwright","slug":"cannot-save-zipped-har-in-thin-clients","errorCode":null,"errorMessage":"Cannot save zipped HAR in thin clients","messagePattern":"Cannot save zipped HAR in thin clients","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/tracing.ts","lineNumber":164,"sourceCode":"  }\n\n  async _exportHAR(harId: string): Promise<void> {\n    const harParams = this._harRecorders.get(harId);\n    if (!harParams)\n      return;\n    this._harRecorders.delete(harId);\n    const isLocal = !this._connection.isRemote();\n    const isZip = harParams.path.endsWith('.zip');\n\n    if (isLocal) {\n      const { entries } = await this._channel.harExport({ harId, mode: 'entries' }, kNoTimeout);\n      if (!isZip) {\n        // Server wrote HAR and resources to the user's chosen paths.\n        return;\n      }\n      const localUtils = this._connection.localUtils();\n      if (!localUtils)\n        throw new Error('Cannot save zipped HAR in thin clients');\n      await localUtils.zip({ zipFile: harParams.path, entries: entries!, mode: 'write', includeSources: false, additionalSources: [] });\n      return;\n    }\n\n    const { artifact: artifactChannel } = await this._channel.harExport({ harId, mode: 'archive' }, kNoTimeout);\n    const artifact = Artifact.from(artifactChannel!);\n    if (isZip) {\n      await artifact.saveAs(harParams.path);\n      await artifact.delete();\n      return;\n    }\n    const localUtils = this._connection.localUtils();\n    if (!localUtils)\n      throw new Error('Uncompressed har is not supported in thin clients');\n    await artifact.saveAs(harParams.path + '.tmp');\n    await localUtils.harUnzip({ zipFile: harParams.path + '.tmp', harFile: harParams.path, resourcesDir: harParams.resourcesDir });\n    await artifact.delete();\n  }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/tracing.ts#L146-L182","documentation":"Error \"Cannot save zipped HAR in thin clients\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/tracing.ts:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}