yarnpkg/yarn · error · Error

requestManagerNotSetupHAR

Error message

requestManagerNotSetupHAR

What it means

Error "requestManagerNotSetupHAR" thrown in yarnpkg/yarn.

Source

Thrown at src/util/request-manager.js:546

  /**
   * Remove an item from the queue. Create it's request options and execute it.
   */

  shiftQueue() {
    if (this.running >= this.max || !this.queue.length) {
      return;
    }

    const opts = this.queue.shift();

    this.running++;
    this.execute(opts);
  }

  saveHar(filename: string) {
    if (!this.captureHar) {
      throw new Error(this.reporter.lang('requestManagerNotSetupHAR'));
    }
    // No request may have occurred at all.
    this._getRequestModule();
    invariant(this._requestCaptureHar != null, 'request-capture-har not setup');
    this._requestCaptureHar.saveHar(filename);
  }
}

View on GitHub (pinned to c2dda503f3)

Solutions

  1. saveHar() was called without HAR capture being enabled. Start yarn with the --har flag (or set the corresponding option) so the request manager sets up request-capture-har, then rerun.
  2. If calling saveHar from your own tooling, ensure config.requestManager.captureHar is true before executing requests.

Example fix

yarn install --har

When it happens

Trigger: Yarn is asked to record or replay HAR traffic but the request manager has not been set up with HAR capture in src/util/request-manager.js.

Common situations: Occurs when HAR capture/save is invoked without enabling request capture first (missing --har setup or internal ordering bug).


AI-assisted analysis of yarnpkg/yarn@c2dda503f3 (2026-08-13). Data as JSON: /api/errors/57155ecc8f2e20f6. Report an issue: GitHub.