diegosouzapw/OmniRoute · error · Error

Browser did not become ready

Error message

Browser did not become ready: ${lastError?.message || "CDP timeout"}

What it means

Readiness timeout in the browser-harvest wait loop: polling http://127.0.0.1:<cdpPort>/json/version never yielded a webSocketDebuggerUrl before the deadline. Each iteration records why it failed (non-JSON, no WS URL, connection refused), and the last error (or a generic CDP timeout) is embedded — the browser never exposed a usable CDP endpoint.

Solutions

  1. Increase the readiness timeoutMs for slow machines
  2. Verify the browser was launched with remote debugging on the expected port
  3. Check the embedded lastError for connection-refused vs malformed-response causes
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/vncSession/harvest.ts:274 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/71fe867a00f99a5d. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/vncSession/harvest.ts:274

  const deadline = Date.now() + timeoutMs;
  let lastError: Error | null = null;

  while (Date.now() < deadline) {
    const controller = new AbortController();
    const timer = setTimeout(() => controller.abort(), 2_000);
    try {
      const version = await fetchJson(`http://127.0.0.1:${cdpPort}/json/version`, controller.signal);
      if (version?.webSocketDebuggerUrl) return;
      lastError = new Error("CDP endpoint did not return a websocket URL");
    } catch (error) {
      lastError = toError(error, "CDP endpoint is not ready");
    } finally {
      clearTimeout(timer);
    }
    await delay(500);
  }

  throw new Error(`Browser did not become ready: ${lastError?.message || "CDP timeout"}`);
}

export async function harvestFromContainer(
  cdpPort: number,
  provider: VncProviderEntry,
  timeoutMs = 20_000
): Promise<HarvestResult> {
  const controller = new AbortController();
  const timeout = setTimeout(() => controller.abort(), timeoutMs);
  let client: CdpClient | null = null;

  try {
    const version = await fetchJson(
      `http://127.0.0.1:${cdpPort}/json/version`,
      controller.signal
    );
    const debuggerUrl = version?.webSocketDebuggerUrl;
    if (typeof debuggerUrl !== "string" || !debuggerUrl) {

View on GitHub (pinned to a179ffed5b)