{"record":{"id":"77961d893f556a34","repo":"jackwener/OpenCLI","slug":"failed-to-read-upwork-job-detail-store-e-messa","errorCode":null,"errorMessage":"Failed to read Upwork job-detail store: ${e?.message ?? e}","messagePattern":"Failed to read Upwork job-detail store: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/upwork/detail.js","lineNumber":79,"sourceCode":"                    ready = haveStore();\n                }\n                const onLogin = /\\\\/(ab\\\\/account-security\\\\/login|nx\\\\/login)/.test(location.pathname);\n                const challenge = (document.title || '').toLowerCase().includes('just a moment') || !!document.querySelector('[id^=\"cf-\"]');\n                if (!ready) {\n                    return { ready, onLogin, challenge, job: null, buyer: null };\n                }\n                const s = window.$nuxt.$store.state.jobDetails;\n                return {\n                    ready,\n                    onLogin,\n                    challenge,\n                    job: s.job ? JSON.parse(JSON.stringify(s.job)) : null,\n                    buyer: s.buyer ? JSON.parse(JSON.stringify(s.buyer)) : null,\n                };\n            })()`));\n        }\n        catch (e) {\n            throw new CommandExecutionError(`Failed to read Upwork job-detail store: ${e?.message ?? e}`, 'The Vuex store was not reachable; try again after opening Upwork in the connected browser.');\n        }\n\n        if (payload?.onLogin) {\n            throw new AuthRequiredError('upwork.com', 'Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.');\n        }\n        if (payload?.challenge) {\n            throw new CommandExecutionError('Upwork served a Cloudflare challenge page', 'Open https://www.upwork.com in the connected browser and clear the challenge, then retry.');\n        }\n        if (!isPlainObject(payload)) {\n            throw new CommandExecutionError('Upwork detail returned an unexpected Browser Bridge payload shape');\n        }\n        if (!payload?.ready || !payload.job) {\n            throw new EmptyResultError('upwork detail', `No Upwork job posting found for id \"${id}\" (may be closed, expired, or private)`);\n        }\n        if (!isPlainObject(payload.job)) {\n            throw new CommandExecutionError('Upwork job-detail store had an unexpected job shape; expected an object.');\n        }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/upwork/detail.js#L61-L97","documentation":"The Upwork detail command reads job data from the page's Vuex store via Browser Bridge page.evaluate. If that evaluation throws (page context unavailable, store not on window, navigation interrupted), the catch wraps the failure in CommandExecutionError with remediation text, preserving the original message.","triggerScenarios":"Running an upwork detail fetch when the Vuex store is unreachable: the connected browser tab isn't on an Upwork job page, the page hasn't finished hydrating its store, a navigation/crash occurred during evaluate, or the Browser Bridge script itself threw inside the page.","commonSituations":"Running the command before opening Upwork in the connected browser; Upwork SPA reloaded mid-read; using a browser where the app bundle changed and window/Vuex exposure differs; slow network leaving the store uninitialized.","solutions":["Open https://www.upwork.com (and the job page) in the connected browser, let it fully load, then retry.","Read the embedded original message (e?.message) in the error to identify the exact in-page failure.","Retry after the page settles — transient navigation during evaluate is a common cause.","Update the library if Upwork changed its Vuex store exposure; an outdated extractor script will throw in-page.","Restart the browser/bridge if evaluation keeps failing on a healthy page."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"await page.goto(jobUrl, { waitUntil: 'networkidle' });\nconst hasStore = await page.evaluate(() => Boolean(document.querySelector('#app, [data-vuex], body') ) );\nif (!page.url().includes('upwork.com')) throw new Error('Not on an Upwork page; open Upwork in the connected browser first');","typeGuard":null,"tryCatchPattern":"try {\n  const detail = await fetchUpworkJobDetail(id);\n} catch (e) {\n  if (e instanceof CommandExecutionError && /Failed to read Upwork job-detail store/.test(e.message)) {\n    console.log('Open https://www.upwork.com in the connected browser, let the page fully load, then retry.');\n  } else throw e;\n}","preventionTips":["Open and fully load the Upwork page in the connected browser before fetching details.","Wait for page hydration (network idle) so the Vuex store exists before evaluate.","Retry once on transient failures caused by mid-evaluate navigation.","Keep the library updated for Upwork store-exposure changes."],"tags":["upwork","vuex","browser-bridge","scraping"],"backgroundTag":"browser-bridge-eval-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}