stablyai/orca · error · BrowserError

browser_navigation_failed

browser_navigation_failed

Error message

Navigation failed: ${errorText}

What it means

CDP Page.navigate returns an errorText field (rather than rejecting the promise) when the browser cannot load the URL. Chromium populates this with net-error codes such as net::ERR_NAME_NOT_RESOLVED, net::ERR_CONNECTION_REFUSED, net::ERR_INVALID_URL, or certificate-error strings. The bridge surfaces it as browser_navigation_failed so callers can distinguish a navigation failure from a CDP protocol failure. After the error, waitForLoad is never reached and the refMap is not invalidated.

Source

Thrown at src/main/browser/cdp-bridge.ts:295

        backendNodeId: node.backendDOMNodeId
      })

      return { uploaded: filePaths.length }
    })
  }

  async goto(url: string): Promise<BrowserGotoResult> {
    return this.enqueueCommand(async () => {
      const guest = this.getActiveGuest()
      const sender = this.makeCdpSender(guest)
      await this.ensureDebuggerAttached(guest)

      const { errorText } = (await sender('Page.navigate', { url })) as {
        errorText?: string
      }

      if (errorText) {
        throw new BrowserError('browser_navigation_failed', `Navigation failed: ${errorText}`)
      }

      await this.waitForLoad(sender, guest)
      this.invalidateRefMap(guest.id)

      return { url: guest.getURL(), title: guest.getTitle() }
    })
  }

  async fill(element: string, value: string): Promise<BrowserFillResult> {
    return this.enqueueCommand(async () => {
      const guest = this.getActiveGuest()
      const sender = this.makeCdpSender(guest)
      await this.ensureDebuggerAttached(guest)

      const node = await this.resolveRef(guest, sender, element)
      const refSender = this.senderForRef(guest, node)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Validate the URL format (protocol, host) before calling goto.
  2. Check DNS resolution and network reachability for the host.
  3. For certificate errors, note that Page.navigate cannot bypass them; configure the app to accept the cert at the session level.
  4. For proxy issues, configure the proxy at the Electron session level before navigating.

Example fix

// before
await bridge.goto('htps://example.com')

// after
try {
  const url = new URL(rawUrl) // throws on malformed URL
  if (!/^https?:$/.test(url.protocol)) throw new Error('Only http(s) supported')
  await bridge.goto(url.href)
} catch (e) {
  if (e instanceof BrowserError && e.code === 'browser_navigation_failed') {
    // parse net:: error code from e.message, report to user
  }
  throw e
}
Defensive patterns

Strategy: validation

Validate before calling

function isValidNavUrl(raw: string): boolean {
  try {
    const u = new URL(raw)
    return u.protocol === 'http:' || u.protocol === 'https:'
  } catch {
    return false
  }
}
if (!isValidNavUrl(url)) throw new Error(`Invalid URL: ${url}`)
await bridge.goto(url)

Type guard

function isNavigableUrl(raw: string): raw is string {
  try {
    const u = new URL(raw)
    return u.protocol === 'http:' || u.protocol === 'https:'
  } catch {
    return false
  }
}

Try / catch

try {
  await bridge.goto(url)
} catch (e) {
  if (e instanceof BrowserError && e.code === 'browser_navigation_failed') {
    // extract net:: error code from e.message and report to user
  }
  throw e
}

Prevention

When it happens

Trigger: Calling goto(url) with an unreachable host, malformed URL, SSL certificate error, proxy/firewall block, or DNS resolution failure.

Common situations: Typo in the URL; target site is down; corporate proxy blocking the request; self-signed HTTPS cert; navigating to a non-http scheme Chromium rejects (e.g., file:// without permission).

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/4fd6c523063fa7ca. Report an issue: GitHub.