{"record":{"id":"53f9d27e175d4340","repo":"CloakHQ/CloakBrowser","slug":"pinned-download-completed-but-binary-not-found-at","errorCode":null,"errorMessage":"Pinned download completed but binary not found at expected path: ${binaryPath}. This may indicate a packaging issue. Please report at https://github.com/CloakHQ/cloakbrowser/issues","messagePattern":"Pinned download completed but binary not found at expected path: (.+?)\\. This may indicate a packaging issue\\. Please report at https://github\\.com/CloakHQ/cloakbrowser/issues","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"js/src/download.ts","lineNumber":161,"sourceCode":"  }\n\n  // Fail fast if no binary available for this platform\n  checkPlatformAvailable();\n\n  if (requestedVersion) {\n    const binaryPath = getBinaryPath(requestedVersion);\n    if (fs.existsSync(binaryPath) && isExecutable(binaryPath)) {\n      showWelcome();\n      return binaryPath;\n    }\n\n    console.log(\n      `[cloakbrowser] Stealth Chromium ${requestedVersion} not found. Downloading for ${getPlatformTag()}...`\n    );\n    await downloadAndExtract(requestedVersion);\n\n    if (!fs.existsSync(binaryPath) || !isExecutable(binaryPath)) {\n      throw new Error(\n        `Pinned download completed but binary not found at expected path: ${binaryPath}. ` +\n          `This may indicate a packaging issue. Please report at ` +\n          `https://github.com/CloakHQ/cloakbrowser/issues`\n      );\n    }\n    showWelcome();\n    return binaryPath;\n  }\n\n  // Check for auto-updated version first, then fall back to hardcoded\n  const effective = getEffectiveVersion();\n  const binaryPath = getBinaryPath(effective);\n\n  if (fs.existsSync(binaryPath) && isExecutable(binaryPath)) {\n    showWelcome();\n    maybeTriggerUpdateCheck();\n    return binaryPath;\n  }","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/download.ts#L143-L179","documentation":"UnsupportedHumanizeSelectorError(selector) is raised in _get_element_box_async when the isolated-world geometry script reports UNSUPPORTED for the given selector. The humanizer only supports a subset of selector engines (typically CSS) inside the isolated world, so XPath, text=, and other Playwright-specific engines are rejected.","triggerScenarios":"Passing selectors like `//div[@id='x']`, `text=Sign in`, or `div >> nth=0` to async humanized get/scroll helpers — build_box_js cannot compile them into the isolated-world query, returning UNSUPPORTED.","commonSituations":"Copy-pasting selectors from Playwright traces or devtools; recorded scripts using get_by_text equivalents; refactoring from page.locator pipelines into humanized helpers without converting selector syntax.","solutions":["Convert the selector to pure CSS: replace XPath/text selectors with CSS equivalents (e.g. `a[href='/login']`, `[data-testid='submit']`).","If you only have a Playwright Locator, resolve it to a CSS path or use its bounding element's stable attribute selector.","Check the library's supported selector list in the humanize module docs before passing values."],"exampleFix":"// before\nbox = await _get_element_box_async(page, \"text=Sign in\")\n\n// after\nbox = await _get_element_box_async(page, \"button[data-testid='sign-in']\")","handlingStrategy":"validation","validationCode":"import re\nassert not re.search(r\"(^//|text=|>> |:has-text|nth=)\", sel), 'use pure CSS selectors for humanize'","typeGuard":"def is_supported_selector(sel: str) -> bool:\n    import re\n    return re.fullmatch(r\"[a-zA-Z0-9_\\-\\[\\]\\.\\='#:\\\"\\s\\*,>\\(\\)]+\", sel) is not None and not sel.startswith('//')","tryCatchPattern":"try:\n    box = await _get_element_box_async(page, sel)\nexcept UnsupportedHumanizeSelectorError:\n    box = await _get_element_box_async(page, css_equivalent(sel))","preventionTips":["Convert XPath/text selectors to CSS before humanized calls","Add data-testid attributes to make CSS conversion trivial","Check the humanize module's supported selector engines"],"tags":["selector","async","validation","xpath"],"backgroundTag":"unsupported-selector-syntax","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}