jackwener/OpenCLI · error · CommandExecutionError
`Failed to inspect GeoGebra object: ${exists.error}`
Error message
`Failed to inspect GeoGebra object: ${exists.error}` What it means
Thrown when the probe succeeded structurally but the in-page script reported an error in its envelope ({error: '...'}) — most commonly 'ggbApplet is not ready', or an exception thrown by ggbApplet.getObjectType inside the page. The library surfaces it as a CommandExecutionError prefixed with 'Failed to inspect GeoGebra object'.
Source
Thrown at clis/geogebra/info.js:45
try {
if (typeof ggbApplet === 'undefined' || typeof ggbApplet.getObjectType !== 'function') {
return { error: 'ggbApplet is not ready' };
}
return { ok: true, exists: ggbApplet.getObjectType(name) !== '' };
} catch (err) {
return { error: err?.message || String(err) };
}
})
(${JSON.stringify(objName)})
`));
} catch (err) {
throw new CommandExecutionError(`Failed to inspect GeoGebra object: ${err?.message || err}`);
}
if (!exists || typeof exists !== 'object' || Array.isArray(exists)) {
throw new CommandExecutionError('GeoGebra object existence probe returned malformed result');
}
if (exists.error) {
throw new CommandExecutionError(`Failed to inspect GeoGebra object: ${exists.error}`);
}
if (exists.ok !== true || typeof exists.exists !== 'boolean') {
throw new CommandExecutionError('GeoGebra object existence probe returned malformed result');
}
if (exists.exists === false) {
throw new EmptyResultError(`geogebra info ${objName}`, `Object "${objName}" not found on the canvas.`);
}
const properties = ['type', 'value', 'definition', 'command', 'caption', 'visible', 'color'];
const rows = [];
for (const prop of properties) {
const val = await ggbGetProperty(page, objName, prop);
rows.push({ property: prop, value: String(val ?? '') });
}
// For point-like objects, also include coordinates
const objType = await ggbGetProperty(page, objName, 'type');
if (objType === 'point') {View on GitHub (pinned to 49907e53dc)
Solutions
- Wait a moment and retry so the applet finishes initializing
- Run a `geogebra eval` command first to force ensureApplet to wait for ggbApplet readiness
- Verify the page is an official GeoGebra applet page (geometry/graphing) where the global is ggbApplet
- Read the appended exists.error text — 'ggbApplet is not ready' means timing; other text points to the in-page cause
Example fix
// before opencli geogebra info --name A # 'ggbApplet is not ready' right after navigate // after opencli geogebra eval --code '1+1' # waits for applet opencli geogebra info --name A
Defensive patterns
Strategy: retry
Validate before calling
// wait-for-applet pre-check before info
await run('geogebra', 'eval', '--code', '1+1'); // forces ensureApplet/ggbApplet readiness Try / catch
try {
await run('geogebra', 'info', '--name', 'A');
} catch (err) {
if (/ggbApplet is not ready/.test(err.message)) {
await sleep(1500);
return retry(2);
}
throw err;
} Prevention
- Always warm up the applet with an eval call before inspecting
- Avoid running info in the same instant as navigation
- Check the appended error text to distinguish timing vs structural issues
When it happens
Trigger: `geogebra info --name X` before the applet global (ggbApplet) exists or lacks getObjectType; or getObjectType throws for the given name (e.g. injection/serialization issue in the page context).
Common situations: Running info immediately after navigation before the applet finishes booting; using a GeoGebra page variant that names the API object differently; applet still loading on slow networks.
Related errors
- `Failed to inspect GeoGebra object: ${err?.message || err}`
- GeoGebra object existence probe returned malformed result
- Failed to detect GeoGebra applet: ${err?.message || err}
- Failed to load GeoGebra Geometry: ${err?.message || err}
- ggbApplet not available after waiting. Make sure the GeoGebr
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/fe92e0bca6b7c0fe.
Report an issue: GitHub.