jackwener/OpenCLI · error · CommandExecutionError

Marketplace button not found

Error message

Marketplace button not found

What it means

The Qoder 'marketplace' UI command clicks a visible element whose text contains 'Marketplace' via clickByTextScript. If the evaluate returns {ok:false} (no matching visible button/tab/anchor), the command throws CommandExecutionError('Marketplace button not found'). It signals the marketplace entry point was not found in the rendered Qoder DOM.

Source

Thrown at clis/qoder/ui.js:167

        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Knowledge button not found', '');
        return [{ Status: 'clicked' }];
    },
});

// -------- marketplace --------
cli({
    site: 'qoder',
    name: 'marketplace',
    access: 'write',
    description: 'Open the Qoder Marketplace.',
    domain: 'localhost',
    strategy: Strategy.UI,
    browser: true,
    args: [],
    columns: ['Status'],
    func: async (page) => {
        const res = await evaluateQoder(page, clickByTextScript(['Marketplace']));
        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Marketplace button not found', '');
        return [{ Status: 'clicked' }];
    },
});

// -------- credits --------
cli({
    site: 'qoder',
    name: 'credits',
    access: 'read',
    description: 'Click "Credits Usage" and return the credits-usage display text.',
    domain: 'localhost',
    strategy: Strategy.UI,
    browser: true,
    args: [],
    columns: ['Field', 'Value'],
    func: async (page) => {
        const res = await evaluateQoder(page, clickByTextScript(['Credits Usage']));
        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Credits Usage not visible', '');

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Confirm Qoder is running with the window visible and the marketplace icon is on screen, then retry.
  2. Wait for full UI load (increase the initial wait) and re-run the command.
  3. Close any modal/update dialogs blocking the activity bar.
  4. Verify the current button label in Qoder's DOM via CDP DevTools and update the text pattern in clis/qoder/ui.js if changed.
  5. Attach to the correct CDP target (main window, port 9237) rather than a worker/iframe page.

Example fix

// before
const res = await evaluateQoder(page, clickByTextScript(['Marketplace']));
if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Marketplace button not found', '');
// after: also try icon fallback selectors
let res = await evaluateQoder(page, clickByTextScript(['Marketplace']));
if (!res?.ok) res = await evaluateQoder(page, clickFirstScript(['[aria-label*="marketplace" i]', '[title*="marketplace" i]']));
Defensive patterns

Strategy: retry

Validate before calling

async function marketplaceButtonVisible(page) {
  const probe = await page.evaluate(`(() => {
    const els = Array.from(document.querySelectorAll('button, [role="button"], a, [role="tab"]'));
    return els.some(b => (b.innerText||'').toLowerCase().includes('marketplace') && b.getBoundingClientRect().width > 0);
  })()`);
  return probe === true;
}

Type guard

function isClickResult(res) {
  return res !== null && typeof res === 'object' && typeof res.ok === 'boolean';
}

Try / catch

try {
  await cli.run(['qoder', 'marketplace']);
} catch (e) {
  if (String(e.message).includes('Marketplace button not found')) {
    await page.wait(3);
    await cli.run(['qoder', 'marketplace']);
  } else throw e;
}

Prevention

When it happens

Trigger: Running the 'marketplace' command while Qoder's UI is still loading, the Marketplace button is hidden behind a dialog, the label changed in a newer Qoder build, or the element is not one of the selectors scanned by clickByTextScript (button, [role=button], a, [role=tab]).

Common situations: Qoder updated and renamed/moved the marketplace entry; IDE opened without a workspace so the top bar differs; running against a minimized/off-screen Electron window where isVisible (zero-size rect) fails; CDP attached to the wrong Electron page.

Related errors


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