{"record":{"id":"b09d6b07984173be","repo":"microsoft/playwright","slug":"har-recording-has-already-been-started","errorCode":null,"errorMessage":"HAR recording has already been started","messagePattern":"HAR recording has already been started","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/tracing.ts","lineNumber":106,"sourceCode":"  }\n\n  async stopChunk(options: { path?: string } = {}) {\n    await this._wrapApiCall(async () => {\n      await this._doStopChunk(options.path);\n    });\n  }\n\n  async stop(options: { path?: string } = {}) {\n    await this._wrapApiCall(async () => {\n      await this._doStopChunk(options.path);\n      await this._channel.tracingStop({}, kNoTimeout);\n    });\n  }\n\n  async startHar(path: string, options: { content?: 'embed' | 'attach' | 'omit', mode?: 'full' | 'minimal', urlFilter?: string | RegExp, resourcesDir?: string } = {}) {\n    await this._wrapApiCall(async () => {\n      if (this._harId)\n        throw new Error('HAR recording has already been started');\n      if (options.resourcesDir && path.endsWith('.zip'))\n        throw new Error('resourcesDir option is not compatible with a .zip har file');\n      const defaultContent = path.endsWith('.zip') ? 'attach' : 'embed';\n      this._harId = await this._recordIntoHAR(path, null, {\n        url: options.urlFilter,\n        updateContent: options.content ?? defaultContent,\n        updateMode: options.mode ?? 'full',\n        resourcesDir: options.resourcesDir,\n      });\n    });\n    return new DisposableStub(() => this.stopHar());\n  }\n\n  async stopHar() {\n    await this._wrapApiCall(async () => {\n      const harId = this._harId;\n      if (!harId)\n        throw new Error('HAR recording has not been started');","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/tracing.ts#L88-L124","documentation":"Error \"HAR recording has already been started\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/tracing.ts:106 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"}