{"record":{"id":"f599b46031d3d296","repo":"jackwener/OpenCLI","slug":"upwork-feed-state-window-nuxt-state-stateke","errorCode":null,"errorMessage":"Upwork feed state (window.__NUXT__.state.${stateKey}) was not present within 15s","messagePattern":"Upwork feed state \\(window\\.__NUXT__\\.state\\.(.+?)\\) was not present within 15s","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/upwork/feed.js","lineNumber":89,"sourceCode":"                    challenge,\n                    jobsPresent: !!(state && Object.prototype.hasOwnProperty.call(state, 'jobs')),\n                    jobs: state ? state.jobs : undefined,\n                    paging: state && state.paging ? state.paging : null,\n                };\n            })()`));\n        }\n        catch (e) {\n            throw new CommandExecutionError(`Failed to read Upwork feed state: ${e?.message ?? e}`, 'The Nuxt state global 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 (!payload?.ready) {\n            throw new CommandExecutionError(`Upwork feed state (window.__NUXT__.state.${stateKey}) was not present within 15s`, 'The page may not have finished hydrating, or the SSR state shape may have changed.');\n        }\n        if (!isPlainObject(payload)) {\n            throw new CommandExecutionError('Upwork feed returned an unexpected Browser Bridge payload shape');\n        }\n        if (!payload.jobsPresent || !Array.isArray(payload.jobs)) {\n            throw new CommandExecutionError(`Upwork feed state had an unexpected jobs shape; expected window.__NUXT__.state.${stateKey}.jobs to be an array.`);\n        }\n\n        const jobs = payload.jobs;\n        if (jobs.length === 0) {\n            throw new EmptyResultError(`upwork feed ${tab}`, `Upwork ${tab} feed is empty for the current account`);\n        }\n\n        const rows = jobsToListRows(jobs, { limit });\n        if (rows.length === 0) {\n            throw new CommandExecutionError('Upwork feed results did not include any job with a valid ciphertext id; cannot produce round-trippable detail rows.');\n        }\n        return rows;","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/upwork/feed.js#L71-L107","documentation":"After login and challenge checks, the feed probe waits up to 15s (30 x 500ms) for window.__NUXT__.state.<feedKey> to appear. If the ready flag is still false, this CommandExecutionError is thrown: the expected SSR/Nuxt state node for the chosen tab never hydrated. The message interpolates the stateKey (feedBestMatch or feedMostRecent).","triggerScenarios":"Running `upwork feed` when the page loaded but the Nuxt state node never appeared: slow network causing hydration to exceed 15s, Upwork's SPA changing its state tree so feedBestMatch/feedMostRecent no longer exists, or the feed failing to load server-side while still past the login/challenge checks.","commonSituations":"Slow connection or heavy page (many trackers) delaying hydration; Upwork frontend redesign renaming/moving __NUXT__.state keys; running on an account whose feed endpoint errors; the page half-loaded because navigation raced with page.goto.","solutions":["Re-run the command — transient slow hydration often succeeds on a second attempt.","Check your network speed / retry from a faster connection; the 15s poll is fixed.","Open the feed URL in the connected browser and inspect window.__NUXT__.state in DevTools to see if the state key changed; if so, update the CLI to match the new Upwork build.","Verify the account actually has a personalized feed (new accounts or certain locales may not populate feedBestMatch)."],"exampleFix":"// before\nawait upwork.feed('most-recent'); // timeout on a slow connection\n// after\nawait page.goto(url); // pre-warm the page in the connected browser first\nconst jobs = await upwork.feed('most-recent');","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const jobs = await upwork.feed();\n} catch (e) {\n  if (/was not present within 15s/.test(e.message) && attempts < 2) {\n    await sleep(5000);\n    return feedWithRetry(attempts + 1);\n  }\n  throw e;\n}","preventionTips":["Run on a reasonably fast connection; slow hydration can exceed the fixed 15s poll.","Retry once automatically before reporting failure — slow loads are often transient.","If it fails consistently, verify in DevTools that window.__NUXT__.state.feedBestMatch still exists (Upwork may have changed its state tree) and update the CLI.","Pre-warm the page in the connected browser before scripted reads."],"tags":["upwork","timeout","nuxt-state","hydration","browser-automation"],"backgroundTag":"hydration-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}