{"record":{"id":"de6e24c13a3f0d8b","repo":"microsoft/playwright","slug":"debugger-is-already-paused","errorCode":null,"errorMessage":"Debugger is already paused","messagePattern":"Debugger is already paused","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/playwright-core/src/server/debugger.ts","lineNumber":89,"sourceCode":"  private _muted = false;\n\n  constructor(context: BrowserContext) {\n    super(context, 'debugger');\n    this._context = context;\n    (this._context as any)[symbol] = this;\n    // Register as a last listener so the debugger pause runs after other listeners\n    // (e.g. recorder action-point capture) have recorded their state.\n    context.instrumentation.addListener(this, context, { order: 'last' });\n    this._context.once(BrowserContext.Events.Close, () => {\n      this._context.instrumentation.removeListener(this);\n      if (this._apiCallsFlushTimer)\n        clearTimeout(this._apiCallsFlushTimer);\n    });\n  }\n\n  requestPause(progress: Progress) {\n    if (this.isPaused())\n      throw new Error('Debugger is already paused');\n    this.setPauseBeforeWaitingActions();\n    this.setPauseAt({ next: true });\n  }\n\n  doResume(progress: Progress) {\n    if (!this.isPaused())\n      throw new Error('Debugger is not paused');\n    this.resume();\n  }\n\n  next(progress: Progress) {\n    if (!this.isPaused())\n      throw new Error('Debugger is not paused');\n    this.setPauseBeforeWaitingActions();\n    this.setPauseAt({ next: true });\n    this.resume();\n  }\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/debugger.ts#L71-L107","documentation":"Thrown by Debugger.requestPause (debugger.ts:89) when isPaused() is already true. The inspector debugger only allows one outstanding pause; requesting another while paused is a user error in the sequencing of pause/resume calls.","triggerScenarios":"Calling pause() twice without a resume; calling pause() while the recorder/codegen Inspector is already paused at a breakpoint; pause issued from two concurrent tooling layers.","commonSituations":"Custom inspector tooling layered on top of the recorder; double-clicking a 'pause' button; race between an automatic pause-on-assert and a manual pause.","solutions":["Guard the call: only requestPause when isPaused() is false.","Resume before re-pausing.","Serialize pause/resume through a single owner."],"exampleFix":"// before\nawait dbg.requestPause();\nawait dbg.requestPause();\n// after\nif (!dbg.isPaused()) await dbg.requestPause();","handlingStrategy":"type-guard","validationCode":"// Only request a pause when not already paused.\nif (!dbg.isPaused()) {\n  await dbg.requestPause();\n}","typeGuard":"// Ensure the debugger reports it is not paused before requesting a pause.\nconst canPause = (dbg: { isPaused(): boolean }) => !dbg.isPaused();","tryCatchPattern":null,"preventionTips":["Serialize pause ownership through a single caller.","Always check isPaused() before requestPause().","Resume before re-pausing."],"tags":["debugger","inspector","state"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}