jackwener/OpenCLI · critical · CommandExecutionError

Failed to load GeoGebra Geometry: ${err?.message || err}

Error message

Failed to load GeoGebra Geometry: ${err?.message || err}

What it means

ensureApplet() navigates to the GeoGebra Geometry URL when the current page is not already there. If page.goto() fails (network error, DNS failure, TLS problem, timeout, offline), it throws CommandExecutionError 'Failed to load GeoGebra Geometry: ...' wrapping the navigation error.

Source

Thrown at clis/geogebra/utils.js:92

  try {
    currentUrl = await page.getCurrentUrl();
  } catch {
    currentUrl = '';
  }
  // If already on the geometry page, check if applet is ready without re-navigating
  if (currentUrl?.includes('geogebra.org/geometry')) {
    try {
      const ready = unwrapBridgeEnvelope(await page.evaluate(`typeof ggbApplet !== 'undefined' && typeof ggbApplet.evalCommand === 'function'`));
      if (ready) return;
    } catch (err) {
      throw new CommandExecutionError(`Failed to detect GeoGebra applet: ${err?.message || err}`);
    }
  }
  // Navigate to GeoGebra Geometry
  try {
    await page.goto(GEOGEBRA_URL);
  } catch (err) {
    throw new CommandExecutionError(`Failed to load GeoGebra Geometry: ${err?.message || err}`);
  }

  let ready;
  try {
    ready = unwrapBridgeEnvelope(await page.evaluate(`
      (async () => {
        const deadline = Date.now() + ${APPLET_WAIT_MS};
        while (Date.now() < deadline) {
          if (typeof ggbApplet !== 'undefined' && typeof ggbApplet.evalCommand === 'function') {
            return true;
          }
          await new Promise(r => setTimeout(r, 500));
        }
        return false;
      })()
    `));
  } catch (err) {
    throw new CommandExecutionError(`Failed to detect GeoGebra applet: ${err?.message || err}`);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Confirm network access by loading https://www.geogebra.org/geometry in a normal browser.
  2. Check proxy/firewall/VPN settings and allow geogebra.org; if behind a proxy, configure the browser launch with the proxy flag.
  3. Retry after a transient outage — wrap in a retry with backoff.
  4. If offline use is required, pre-load the GeoGebra applet or serve it locally and point GEOGEBRA_URL at the local copy.

Example fix

// before
await goto(GEOGEBRA_URL); // net::ERR_NAME_NOT_RESOLVED
// after
try { await goto(GEOGEBRA_URL); } catch (e) { await new Promise(r => setTimeout(r, 2000)); await goto(GEOGEBRA_URL); }
Defensive patterns

Strategy: retry

Validate before calling

const reachable = await fetch('https://www.geogebra.org', { method: 'HEAD' }).then(r => r.ok).catch(() => false);
if (!reachable) throw new Error('geogebra.org unreachable — check network/proxy');

Type guard

null

Try / catch

try { await ensureApplet(page); } catch (e) { if (String(e.message).includes('Failed to load')) { await sleep(2000); await ensureApplet(page); } else throw e; }

Prevention

When it happens

Trigger: Calling any geometry tool while offline, geogebra.org unreachable (DNS/proxy/firewall), HTTPS certificate problems, or goto timeout because the page hangs — any err thrown by page.goto(GEOGEBRA_URL).

Common situations: Corporate proxies blocking geogebra.org, sandboxed/air-gapped environments, captive portals, transient network outages, or headless environments missing CA certificates.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/05ebe82ac9355ab1. Report an issue: GitHub.