microsoft/playwright · warning · Error

Debugger is already paused

Error message

Debugger is already paused

What it means

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.

Source

Thrown at packages/playwright-core/src/server/debugger.ts:89

  private _muted = false;

  constructor(context: BrowserContext) {
    super(context, 'debugger');
    this._context = context;
    (this._context as any)[symbol] = this;
    // Register as a last listener so the debugger pause runs after other listeners
    // (e.g. recorder action-point capture) have recorded their state.
    context.instrumentation.addListener(this, context, { order: 'last' });
    this._context.once(BrowserContext.Events.Close, () => {
      this._context.instrumentation.removeListener(this);
      if (this._apiCallsFlushTimer)
        clearTimeout(this._apiCallsFlushTimer);
    });
  }

  requestPause(progress: Progress) {
    if (this.isPaused())
      throw new Error('Debugger is already paused');
    this.setPauseBeforeWaitingActions();
    this.setPauseAt({ next: true });
  }

  doResume(progress: Progress) {
    if (!this.isPaused())
      throw new Error('Debugger is not paused');
    this.resume();
  }

  next(progress: Progress) {
    if (!this.isPaused())
      throw new Error('Debugger is not paused');
    this.setPauseBeforeWaitingActions();
    this.setPauseAt({ next: true });
    this.resume();
  }

View on GitHub (pinned to c8fc3bf8d3)

Solutions

  1. Guard the call: only requestPause when isPaused() is false.
  2. Resume before re-pausing.
  3. Serialize pause/resume through a single owner.

Example fix

// before
await dbg.requestPause();
await dbg.requestPause();
// after
if (!dbg.isPaused()) await dbg.requestPause();
Defensive patterns

Strategy: type-guard

Validate before calling

// Only request a pause when not already paused.
if (!dbg.isPaused()) {
  await dbg.requestPause();
}

Type guard

// Ensure the debugger reports it is not paused before requesting a pause.
const canPause = (dbg: { isPaused(): boolean }) => !dbg.isPaused();

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12). Data as JSON: /api/errors/de6e24c13a3f0d8b. Report an issue: GitHub.