{"record":{"id":"05ebe82ac9355ab1","repo":"jackwener/OpenCLI","slug":"failed-to-load-geogebra-geometry-err-message","errorCode":null,"errorMessage":"Failed to load GeoGebra Geometry: ${err?.message || err}","messagePattern":"Failed to load GeoGebra Geometry: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"critical","filePath":"clis/geogebra/utils.js","lineNumber":92,"sourceCode":"  try {\n    currentUrl = await page.getCurrentUrl();\n  } catch {\n    currentUrl = '';\n  }\n  // If already on the geometry page, check if applet is ready without re-navigating\n  if (currentUrl?.includes('geogebra.org/geometry')) {\n    try {\n      const ready = unwrapBridgeEnvelope(await page.evaluate(`typeof ggbApplet !== 'undefined' && typeof ggbApplet.evalCommand === 'function'`));\n      if (ready) return;\n    } catch (err) {\n      throw new CommandExecutionError(`Failed to detect GeoGebra applet: ${err?.message || err}`);\n    }\n  }\n  // Navigate to GeoGebra Geometry\n  try {\n    await page.goto(GEOGEBRA_URL);\n  } catch (err) {\n    throw new CommandExecutionError(`Failed to load GeoGebra Geometry: ${err?.message || err}`);\n  }\n\n  let ready;\n  try {\n    ready = unwrapBridgeEnvelope(await page.evaluate(`\n      (async () => {\n        const deadline = Date.now() + ${APPLET_WAIT_MS};\n        while (Date.now() < deadline) {\n          if (typeof ggbApplet !== 'undefined' && typeof ggbApplet.evalCommand === 'function') {\n            return true;\n          }\n          await new Promise(r => setTimeout(r, 500));\n        }\n        return false;\n      })()\n    `));\n  } catch (err) {\n    throw new CommandExecutionError(`Failed to detect GeoGebra applet: ${err?.message || err}`);","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/geogebra/utils.js#L74-L110","documentation":"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.","triggerScenarios":"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).","commonSituations":"Corporate proxies blocking geogebra.org, sandboxed/air-gapped environments, captive portals, transient network outages, or headless environments missing CA certificates.","solutions":["Confirm network access by loading https://www.geogebra.org/geometry in a normal browser.","Check proxy/firewall/VPN settings and allow geogebra.org; if behind a proxy, configure the browser launch with the proxy flag.","Retry after a transient outage — wrap in a retry with backoff.","If offline use is required, pre-load the GeoGebra applet or serve it locally and point GEOGEBRA_URL at the local copy."],"exampleFix":"// before\nawait goto(GEOGEBRA_URL); // net::ERR_NAME_NOT_RESOLVED\n// after\ntry { await goto(GEOGEBRA_URL); } catch (e) { await new Promise(r => setTimeout(r, 2000)); await goto(GEOGEBRA_URL); }","handlingStrategy":"retry","validationCode":"const reachable = await fetch('https://www.geogebra.org', { method: 'HEAD' }).then(r => r.ok).catch(() => false);\nif (!reachable) throw new Error('geogebra.org unreachable — check network/proxy');","typeGuard":"null","tryCatchPattern":"try { await ensureApplet(page); } catch (e) { if (String(e.message).includes('Failed to load')) { await sleep(2000); await ensureApplet(page); } else throw e; }","preventionTips":["Pre-check connectivity to geogebra.org in CI/health checks.","Configure proxy settings on the browser launch if behind a corporate proxy.","Use exponential backoff for navigation retries.","Cache the geometry page in long sessions to reduce reloads."],"tags":["network","navigation","browser","geogebra"],"backgroundTag":"page-load-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}