microsoft/playwright · error · Error

Response has been disposed

Error message

Response has been disposed

What it means

Error "Response has been disposed" thrown in microsoft/playwright.

Source

Thrown at packages/playwright-core/src/client/fetch.ts:377

      startTime: -1,
      domainLookupStart: -1,
      domainLookupEnd: -1,
      connectStart: -1,
      secureConnectionStart: -1,
      connectEnd: -1,
      requestStart: -1,
      responseStart: -1,
      ...this._initializer.timing,
      responseEnd: this._initializer.responseEndTiming ?? -1,
    };
  }

  async body(): Promise<Buffer> {
    return await this._request._wrapApiCall(async () => {
      try {
        const result = await this._request._channel.fetchResponseBody({ fetchUid: this._fetchUid() }, kNoTimeout);
        if (result.binary === undefined)
          throw new Error('Response has been disposed');
        return result.binary;
      } catch (e) {
        if (isTargetClosedError(e))
          throw new Error('Response has been disposed');
        throw e;
      }
    }, { internal: true });
  }

  async text(): Promise<string> {
    const content = await this.body();
    return content.toString('utf8');
  }

  async json(): Promise<any> {
    const content = await this.text();
    return JSON.parse(content);
  }

View on GitHub (pinned to c8fc3bf8d3)

When it happens

Trigger: Thrown at packages/playwright-core/src/client/fetch.ts:377 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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