{"record":{"id":"b7e12bb102d40cbe","repo":"microsoft/playwright","slug":"pending-client-connection-closed","errorCode":null,"errorMessage":"Pending client connection closed","messagePattern":"Pending client connection closed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/extension/src/background.ts","lineNumber":105,"sourceCode":"        } catch (error: any) {\n          sendResponse({ success: false, error: error.message });\n        }\n        return true;\n      case 'keepalive':\n        // Connect page pings us every ~20s so receiving this message resets\n        // the MV3 service worker idle timer and keeps the relay WebSocket alive.\n        return false;\n    }\n  }\n\n  private async _connectTab(selectorTabId: number, tab: chrome.tabs.Tab & { id: number }, clientName: string | undefined): Promise<void> {\n    try {\n      await this._cleanupPromise;\n      this._disconnect('Another connection is requested');\n\n      const connection = await this._pendingConnections.take(selectorTabId);\n      if (!connection)\n        throw new Error('Pending client connection closed');\n\n      const group = new ConnectedTabGroup(connection, tab);\n      group.onclose = () => {\n        if (this._activeGroup === group) {\n          this._activeGroup = undefined;\n          this._activeClientName = undefined;\n        }\n      };\n      this._activeGroup = group;\n      this._activeClientName = clientName;\n\n      await Promise.all([\n        chrome.tabs.update(tab.id, { active: true }),\n        chrome.windows.update(tab.windowId, { focused: true }),\n      ]).catch(() => {});\n\n      if (tab.id !== selectorTabId)\n        await chrome.tabs.remove(selectorTabId).catch(() => {});","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/extension/src/background.ts#L87-L123","documentation":"Error \"Pending client connection closed\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/extension/src/background.ts:105 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"}