{"record":{"id":"1124e30c8f544cf1","repo":"jackwener/OpenCLI","slug":"failed-to-navigate-to-facebook-feed-err-instan","errorCode":null,"errorMessage":"`Failed to navigate to facebook feed: ${err instanceof Error ? err.message : err}`","messagePattern":"`Failed to navigate to facebook feed: (.+?)`","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/facebook/feed.js","lineNumber":349,"sourceCode":"    if (rowCount >= limit) break;\n\n    if (markerCount === prevMarkerCount && rowCount === prevRowCount) {\n      stalledPasses += 1;\n      if (stalledPasses >= 2) break;\n    } else {\n      stalledPasses = 0;\n    }\n    prevMarkerCount = markerCount;\n    prevRowCount = rowCount;\n  }\n}\n\nasync function getFacebookFeed(page, kwargs) {\n  const limit = requireLimit(kwargs.limit ?? 10);\n  try {\n    await page.goto(FACEBOOK_HOME, { settleMs: 4000 });\n  } catch (err) {\n    throw new CommandExecutionError(\n      `Failed to navigate to facebook feed: ${err instanceof Error ? err.message : err}`,\n      'Check that facebook.com is reachable and the browser extension is connected.',\n    );\n  }\n\n  await loadFeedPosts(page, limit);\n\n  let payload;\n  try {\n    payload = unwrapBrowserResult(await page.evaluate(buildFeedExtractScript(limit)));\n  } catch (err) {\n    throw new CommandExecutionError(\n      `Failed to read facebook feed: ${err instanceof Error ? err.message : err}`,\n      'Facebook may not have rendered or the feed markup may have changed.',\n    );\n  }\n\n  if (!payload || typeof payload !== 'object' || !Array.isArray(payload.rows)) {","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/facebook/feed.js#L331-L367","documentation":"getFacebookFeed wraps page.goto(FACEBOOK_HOME) in a try/catch and rethrows any navigation failure as a CommandExecutionError with a remediation hint. This means the browser extension could not load facebook.com within the settle window (4000ms). It is the library's way of converting raw navigation errors (DNS, timeouts, browser disconnected) into a consistent, actionable error type.","triggerScenarios":"page.goto(FACEBOOK_HOME) rejects: no network/DNS failure to facebook.com, browser session not connected (extension disconnected), page closed, navigation timeout, or ERR_NAME_NOT_RESOLVED / ERR_CONNECTION_REFUSED from Chromium.","commonSituations":"Running the CLI with no internet or behind a corporate proxy; the browser extension companion process is not running or has been killed; Facebook regional blocks/DNS issues; the headed Chrome instance was closed before the command ran.","solutions":["Verify facebook.com loads in the connected browser and that general connectivity works (curl or open the URL).","Confirm the browser extension/Chrome session is running and connected before invoking the feed command.","Check proxy/VPN/DNS settings if in a restricted network; retry with a VPN if Facebook is blocked.","Re-run the command; transient network blips during the 4s settle window cause this."],"exampleFix":"// before\nawait page.goto(FACEBOOK_HOME, { settleMs: 4000 });\n// after\ntry {\n  await page.goto(FACEBOOK_HOME, { settleMs: 8000 });\n} catch (err) {\n  if (!(await browser.isConnected())) await startBrowserSession();\n  await page.goto(FACEBOOK_HOME, { settleMs: 8000 });\n}","handlingStrategy":"try-catch","validationCode":"// pre-flight\nif (!navigator.online) throw new Error('offline');\nconst reachable = await fetch('https://www.facebook.com', { method: 'HEAD' }).then(r => r.ok).catch(() => false);\nif (!reachable) throw new Error('facebook.com not reachable from this network');","typeGuard":"function isCommandExecutionError(e) { return e instanceof Error && 'hint' in e; }","tryCatchPattern":"try {\n  const rows = await getFacebookFeed(page, { limit: 10 });\n} catch (err) {\n  if (/Failed to navigate to facebook feed/.test(err.message)) {\n    await ensureBrowserConnected();\n    // retry once\n  } else throw err;\n}","preventionTips":["Ensure the browser extension session is running before invoking feed commands.","Check connectivity/proxy settings to facebook.com in the execution environment.","Allow generous settle time on slow networks.","Retry transient navigation failures once before surfacing to users."],"tags":["network","navigation","browser","facebook"],"backgroundTag":"navigation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}