oven-sh/bun · error · Error

Inspector does not offer a URL

Error message

Inspector does not offer a URL

What it means

Deprecated `url` getter on DebugAdapter: it only ever had a URL when the inspector was a WebSocketInspector; it now throws for Node-style inspectors, signaling callers to migrate to getInspector() and read .url on WebSocketInspector directly.

Solutions

  1. Use getInspector() and check for WebSocketInspector before accessing .url
  2. Update the DAP client to not rely on the deprecated adapter.url getter
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/bun-debug-adapter-protocol/src/debugger/adapter.ts:330 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/8ea1bdb0bbed5708. Report an issue: GitHub.

Appendix: source

Thrown at packages/bun-debug-adapter-protocol/src/debugger/adapter.ts:330

    this.#breakpoints = new Map();
    this.#futureBreakpoints = new Map();
    this.#functionBreakpoints = new Map();
    this.#targets = new Map();
    this.#variableId = 1;
    this.#variables = new Map();
  }

  /**
   * Gets the inspector url. This is deprecated and exists for compat.
   * @deprecated You should get the inspector directly (with .getInspector()), and if it's a WebSocketInspector you can access `.url` direclty.
   */
  get url(): string {
    // This code has been migrated from a time when the inspector was always a WebSocketInspector.
    if (this.inspector instanceof WebSocketInspector) {
      return this.inspector.url;
    }

    throw new Error("Inspector does not offer a URL");
  }

  public getInspector() {
    return this.inspector;
  }

  abstract start(...args: unknown[]): Promise<boolean>;

  /**
   * Sends a request to the JavaScript inspector.
   * @param method the method name
   * @param params the method parameters
   * @returns the response
   * @example
   * const { result, wasThrown } = await adapter.send("Runtime.evaluate", {
   *   expression: "1 + 1",
   * });
   * console.log(result.value); // 2

View on GitHub (pinned to 8c5296ac45)