{"record":{"id":"11323777ef7a1a66","repo":"CloakHQ/CloakBrowser","slug":"download-completed-but-binary-not-found-at-expecte","errorCode":null,"errorMessage":"Download completed but binary not found at expected path: ${downloadedPath}. This may indicate a packaging issue. Please report at https://github.com/CloakHQ/cloakbrowser/issues","messagePattern":"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":199,"sourceCode":"  // Fall back to platform's hardcoded version if effective version binary doesn't exist\n  const platformVersion = getChromiumVersion();\n  if (effective !== platformVersion) {\n    const fallbackPath = getBinaryPath();\n    if (fs.existsSync(fallbackPath) && isExecutable(fallbackPath)) {\n      maybeTriggerUpdateCheck();\n      return fallbackPath;\n    }\n  }\n\n  // Download platform's hardcoded version\n  console.log(\n    `[cloakbrowser] Stealth Chromium ${platformVersion} not found. Downloading for ${getPlatformTag()}...`\n  );\n  await downloadAndExtract();\n\n  const downloadedPath = getBinaryPath();\n  if (!fs.existsSync(downloadedPath)) {\n    throw new Error(\n      `Download completed but binary not found at expected path: ${downloadedPath}. ` +\n      `This may indicate a packaging issue. Please report at ` +\n      `https://github.com/CloakHQ/cloakbrowser/issues`\n    );\n  }\n\n  maybeTriggerUpdateCheck();\n  return downloadedPath;\n}\n\n/** Remove all cached binaries. Forces re-download on next launch. */\nexport function clearCache(): void {\n  const cacheDir = getCacheDir();\n  if (fs.existsSync(cacheDir)) {\n    fs.rmSync(cacheDir, { recursive: true, force: true });\n    console.log(`[cloakbrowser] Cache cleared: ${cacheDir}`);\n  }\n}","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/download.ts#L181-L217","documentation":"StealthEvaluationError(selector) is raised in _get_element_box_async when the isolated-world evaluate returns a status other than OK/NOT_FOUND/UNSUPPORTED — i.e. the geometry probe itself failed inside the isolated world. The selector string is used as the message so you can identify which probe blew up.","triggerScenarios":"async_eval_parsed(world, build_box_js(selector)) returning EVALUATION_FAILED past the retry deadline: page navigating/crashing, isolated world destroyed, or the injected script throwing (e.g. cross-origin restrictions on the element).","commonSituations":"Element inside a cross-origin iframe; page navigation racing the 50ms polling loop for the whole timeout; CDP session dropped in remote debugging; obfuscated pages tampering with execution contexts.","solutions":["Wait for load state / a stable document before the async box read so evaluate stops failing mid-navigation.","Verify the element is not inside a cross-origin iframe — the isolated world cannot measure those; switch to the frame's own page/context first.","Increase the timeout argument so the internal retry loop can outlast transient failures.","Confirm the page/context is still open and _stealth_world is healthy before retrying."],"exampleFix":"// before\nbox = await _get_element_box_async(page, sel, timeout=100)\n\n// after\nawait page.wait_for_load_state('domcontentloaded')\nbox = await _get_element_box_async(page, sel, timeout=5000)","handlingStrategy":"retry","validationCode":"if page.is_closed() or getattr(page, \"_stealth_world\", None) is None:\n    raise RuntimeError('page not ready')\nawait page.wait_for_load_state('domcontentloaded')","typeGuard":"def eval_ready(page) -> bool:\n    return (not page.is_closed()) and getattr(page, \"_stealth_world\", None) is not None","tryCatchPattern":"try:\n    box = await _get_element_box_async(page, sel, timeout=5000)\nexcept StealthEvaluationError:\n    await asyncio.sleep(0.25)\n    box = await _get_element_box_async(page, sel, timeout=5000)","preventionTips":["Give the timeout enough budget (>=5000ms) for the internal retry loop","Avoid measuring elements inside cross-origin iframes","Wait for a stable document before async geometry reads"],"tags":["async","stealth","evaluation","isolated-world"],"backgroundTag":"page-evaluation-failed","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}