microsoft/playwright · error · Error

Route from har is not supported in thin clients

Error message

Route from har is not supported in thin clients

What it means

Error "Route from har is not supported in thin clients" thrown in microsoft/playwright.

Source

Thrown at packages/playwright-core/src/client/page.ts:577

  async addInitScript(script: Function | string | { path?: string, content?: string }, arg?: any, options?: EvaluateOptions) {
    assertEvaluateOptions(options);
    if (options?.exposeFunctions)
      return await addInitScriptWithExposedFunctions(this, script, arg);
    const source = await evaluationScript(script, arg);
    return DisposableObject.from((await this._channel.addInitScript({ source }, kNoTimeout)).disposable);
  }

  async route(url: URLMatch, handler: RouteHandlerCallback, options: { times?: number } = {}): Promise<DisposableStub> {
    this._routes.unshift(new RouteHandler(this._browserContext._options.baseURL, url, handler, options.times));
    await this._updateInterceptionPatterns({ title: 'Route requests' });
    return new DisposableStub(() => this.unroute(url, handler));
  }

  async routeFromHAR(har: string, options: { url?: string | RegExp, notFound?: 'abort' | 'fallback', update?: boolean, updateContent?: 'attach' | 'embed', updateMode?: 'minimal' | 'full'} = {}): Promise<void> {
    const localUtils = this._connection.localUtils();
    if (!localUtils)
      throw new Error('Route from har is not supported in thin clients');
    if (options.update) {
      await this._browserContext.tracing._recordIntoHAR(har, this, options);
      return;
    }
    const harRouter = await HarRouter.create(localUtils, har, options.notFound || 'abort', { urlMatch: options.url });
    this._harRouters.push(harRouter);
    await harRouter.addPageRoute(this);
  }

  async routeWebSocket(url: URLMatch, handler: WebSocketRouteHandlerCallback): Promise<void> {
    this._webSocketRoutes.unshift(new WebSocketRouteHandler(this._browserContext._options.baseURL, url, handler));
    await this._updateWebSocketInterceptionPatterns({ title: 'Route WebSockets' });
  }

  private _disposeHarRouters() {
    this._harRouters.forEach(router => router.dispose());
    this._harRouters = [];
  }

View on GitHub (pinned to c8fc3bf8d3)

When it happens

Trigger: Thrown at packages/playwright-core/src/client/page.ts:577 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/2c6c9ae13b4eebf6. Report an issue: GitHub.