{"record":{"id":"bd1b41c4c9364ea1","repo":"jackwener/OpenCLI","slug":"marketplace-button-not-found","errorCode":null,"errorMessage":"Marketplace button not found","messagePattern":"Marketplace button not found","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/qoder/ui.js","lineNumber":167,"sourceCode":"        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Knowledge button not found', '');\n        return [{ Status: 'clicked' }];\n    },\n});\n\n// -------- marketplace --------\ncli({\n    site: 'qoder',\n    name: 'marketplace',\n    access: 'write',\n    description: 'Open the Qoder Marketplace.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [],\n    columns: ['Status'],\n    func: async (page) => {\n        const res = await evaluateQoder(page, clickByTextScript(['Marketplace']));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Marketplace button not found', '');\n        return [{ Status: 'clicked' }];\n    },\n});\n\n// -------- credits --------\ncli({\n    site: 'qoder',\n    name: 'credits',\n    access: 'read',\n    description: 'Click \"Credits Usage\" and return the credits-usage display text.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [],\n    columns: ['Field', 'Value'],\n    func: async (page) => {\n        const res = await evaluateQoder(page, clickByTextScript(['Credits Usage']));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Credits Usage not visible', '');","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qoder/ui.js#L149-L185","documentation":"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.","triggerScenarios":"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]).","commonSituations":"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.","solutions":["Confirm Qoder is running with the window visible and the marketplace icon is on screen, then retry.","Wait for full UI load (increase the initial wait) and re-run the command.","Close any modal/update dialogs blocking the activity bar.","Verify the current button label in Qoder's DOM via CDP DevTools and update the text pattern in clis/qoder/ui.js if changed.","Attach to the correct CDP target (main window, port 9237) rather than a worker/iframe page."],"exampleFix":"// before\nconst res = await evaluateQoder(page, clickByTextScript(['Marketplace']));\nif (!res?.ok) throw new CommandExecutionError(res?.reason || 'Marketplace button not found', '');\n// after: also try icon fallback selectors\nlet res = await evaluateQoder(page, clickByTextScript(['Marketplace']));\nif (!res?.ok) res = await evaluateQoder(page, clickFirstScript(['[aria-label*=\"marketplace\" i]', '[title*=\"marketplace\" i]']));","handlingStrategy":"retry","validationCode":"async function marketplaceButtonVisible(page) {\n  const probe = await page.evaluate(`(() => {\n    const els = Array.from(document.querySelectorAll('button, [role=\"button\"], a, [role=\"tab\"]'));\n    return els.some(b => (b.innerText||'').toLowerCase().includes('marketplace') && b.getBoundingClientRect().width > 0);\n  })()`);\n  return probe === true;\n}","typeGuard":"function isClickResult(res) {\n  return res !== null && typeof res === 'object' && typeof res.ok === 'boolean';\n}","tryCatchPattern":"try {\n  await cli.run(['qoder', 'marketplace']);\n} catch (e) {\n  if (String(e.message).includes('Marketplace button not found')) {\n    await page.wait(3);\n    await cli.run(['qoder', 'marketplace']);\n  } else throw e;\n}","preventionTips":["Ensure the Qoder window is open and visible (not minimized) before issuing commands","Wait for full IDE startup before UI automation","Keep Qoder updated consciously — re-check button labels after each upgrade","Attach CDP to the main window target, not a secondary page"],"tags":["ui-automation","electron","cdp","selector-not-found"],"backgroundTag":"ui-element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}