{"record":{"id":"2465c3f103803a89","repo":"jackwener/OpenCLI","slug":"failed-to-navigate-to-facebook-notifications-me","errorCode":null,"errorMessage":"Failed to navigate to facebook notifications: ${message}","messagePattern":"Failed to navigate to facebook notifications: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/facebook/notifications.js","lineNumber":280,"sourceCode":"  return extractNotificationRowsFromDoc(document, ${JSON.stringify(limit)}, {\n    stripMark: stripMarkAsReadPrefix,\n    stripChrome: stripAnchorChrome,\n    parseQuery: parseNotifQuery,\n    fbHost: FB_HOST,\n    markPrefixes: MARK_AS_READ_PREFIXES,\n    unreadBadges: UNREAD_BADGE_LABELS,\n  });\n})()\n`;\n}\n\nasync function getFacebookNotifications(page, args) {\n    const limit = normalizeNotificationsLimit(args.limit);\n    try {\n        await page.goto(`${FB_HOST}/notifications`, { waitUntil: 'load', settleMs: 3000 });\n    } catch (error) {\n        const message = error instanceof Error ? error.message : String(error);\n        throw new CommandExecutionError(\n            `Failed to navigate to facebook notifications: ${message}`,\n            'facebook.com may be unreachable',\n        );\n    }\n    let rows;\n    try {\n        rows = await page.evaluate(buildNotificationsScript(limit));\n    } catch (error) {\n        const message = error instanceof Error ? error.message : String(error);\n        if (/AUTH_REQUIRED/i.test(message)) {\n            throw new AuthRequiredError(\n                'facebook.com',\n                'Open Chrome and log in to Facebook before retrying',\n            );\n        }\n        throw new CommandExecutionError(\n            `Failed to read facebook notifications: ${message}`,\n            'facebook.com page may not have rendered or markup may have changed',","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/facebook/notifications.js#L262-L298","documentation":"CommandExecutionError wrapping a navigation failure when page.goto(`${FB_HOST}/notifications`) throws. The original error message is interpolated into the message and a secondary hint ('facebook.com may be unreachable') is attached, so the root cause (DNS, TLS, timeout, crash) is preserved in text.","triggerScenarios":"page.goto throwing because facebook.com is unreachable: DNS failure, network offline, TLS/proxy issues, navigation timeout (settleMs 3000 exceeded), or the page/browser closing mid-navigation.","commonSituations":"Corporate proxy or firewall blocking facebook.com; no internet/DNS outage; very slow connection exceeding navigation waits; browser crashed before goto.","solutions":["Check network connectivity and DNS resolution for facebook.com (ping/curl it)","If behind a proxy/firewall, allow facebook.com or configure proxy env/flags for the browser","Increase navigation timeout/wait tolerance if the connection is slow, then retry","Look at the interpolated inner message in the error text for the precise goto failure and address it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const reachable = await fetch('https://www.facebook.com', { method: 'HEAD' }).then(r => r.ok).catch(() => false);\nif (!reachable) throw new Error('facebook.com unreachable; check network/proxy');","typeGuard":null,"tryCatchPattern":"try {\n  const rows = await getFacebookNotifications(page, args);\n} catch (e) {\n  if (/Failed to navigate to facebook notifications/.test(e.message)) {\n    await waitFor(2000); await retryOnce(); // check the inner message for root cause\n  } else throw e;\n}","preventionTips":["Verify network/DNS/proxy access to facebook.com before running","Increase navigation timeout on slow connections","Check the interpolated inner message for the precise goto error","Ensure the browser/page is alive before navigating"],"tags":["network","navigation","facebook"],"backgroundTag":"navigation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}