jackwener/OpenCLI · warning · EmptyResultError

No objects found on the canvas. Fresh runs start a blank ses

Error message

No objects found on the canvas. Fresh runs start a blank session; use one "eval" call, or inspect an already-bound tab through the browser workspace commands.

What it means

An EmptyResultError from `geogebra list`: the applet was reachable and enumeration succeeded, but zero objects matched (or the canvas is empty). The message explains that sessions do not persist — a fresh run starts a blank canvas — and suggests creating objects via eval or inspecting an already-bound tab.

Source

Thrown at clis/geogebra/list.js:28

  domain: 'www.geogebra.org',
  strategy: Strategy.PUBLIC,
  browser: true,
  navigateBefore: false,
  args: [
    { name: 'type', required: false, help: 'Filter by object type (e.g. "point", "line", "circle")' },
  ],
  columns: ['name', 'type', 'value', 'visible'],
  func: async (page, kwargs) => {
    const filterType = kwargs.type == null || kwargs.type === ''
      ? ''
      : String(kwargs.type).trim().toLowerCase();
    if (filterType && !/^[a-z-]+$/.test(filterType)) {
      throw new ArgumentError('type must be a GeoGebra object type like point, line, or circle');
    }
    await ensureApplet(page);
    const objects = await ggbListObjects(page, filterType);
    if (!Array.isArray(objects) || objects.length === 0) {
      throw new EmptyResultError(
        'geogebra list',
        'No objects found on the canvas. Fresh runs start a blank session; use one "eval" call, or inspect an already-bound tab through the browser workspace commands.',
      );
    }
    return objects;
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Create objects first: opencli geogebra eval --code 'A=(1,2)' etc., then run list
  2. Drop or broaden the --type filter if you expected existing objects of another kind
  3. Bind/navigate to the tab that already holds your construction instead of a fresh session
  4. Run setup and query in the same session/invocation flow

Example fix

// before
opencli geogebra list   # blank fresh session
// after
opencli geogebra eval --code 'A=(1,2);B=(4,5);c=Circle(A,B)'
opencli geogebra list
Defensive patterns

Strategy: fallback

Validate before calling

// ensure the canvas is non-empty before listing
await run('geogebra', 'eval', '--code', "if(!ggbApplet.getAllObjectNames().length) { ggbApplet.evalCommand('A=(0,0)'); }");

Try / catch

try {
  return await run('geogebra', 'list', ...(type ? ['--type', type] : []));
} catch (err) {
  if (/No objects found on the canvas/.test(err.message)) {
    // fallback: seed a default object or report empty state explicitly
    return { objects: [], empty: true };
  }
  throw err;
}

Prevention

When it happens

Trigger: `geogebra list` on a brand-new session before any evalCommand; `geogebra list --type circle` when objects exist but none of that type; objects created in a previous run's tab that is no longer bound.

Common situations: Scripting pipelines that assume state persists between opencli invocations; re-running list in CI without a setup step; filtering by a type that has no instances yet.

Related errors


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