jackwener/OpenCLI · error · CommandExecutionError

Failed to read Upwork job-detail store: ${e?.message ?? e}

Error message

Failed to read Upwork job-detail store: ${e?.message ?? e}

What it means

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.

Source

Thrown at clis/upwork/detail.js:79

                    ready = haveStore();
                }
                const onLogin = /\\/(ab\\/account-security\\/login|nx\\/login)/.test(location.pathname);
                const challenge = (document.title || '').toLowerCase().includes('just a moment') || !!document.querySelector('[id^="cf-"]');
                if (!ready) {
                    return { ready, onLogin, challenge, job: null, buyer: null };
                }
                const s = window.$nuxt.$store.state.jobDetails;
                return {
                    ready,
                    onLogin,
                    challenge,
                    job: s.job ? JSON.parse(JSON.stringify(s.job)) : null,
                    buyer: s.buyer ? JSON.parse(JSON.stringify(s.buyer)) : null,
                };
            })()`));
        }
        catch (e) {
            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.');
        }

        if (payload?.onLogin) {
            throw new AuthRequiredError('upwork.com', 'Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.');
        }
        if (payload?.challenge) {
            throw new CommandExecutionError('Upwork served a Cloudflare challenge page', 'Open https://www.upwork.com in the connected browser and clear the challenge, then retry.');
        }
        if (!isPlainObject(payload)) {
            throw new CommandExecutionError('Upwork detail returned an unexpected Browser Bridge payload shape');
        }
        if (!payload?.ready || !payload.job) {
            throw new EmptyResultError('upwork detail', `No Upwork job posting found for id "${id}" (may be closed, expired, or private)`);
        }
        if (!isPlainObject(payload.job)) {
            throw new CommandExecutionError('Upwork job-detail store had an unexpected job shape; expected an object.');
        }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open https://www.upwork.com (and the job page) in the connected browser, let it fully load, then retry.
  2. Read the embedded original message (e?.message) in the error to identify the exact in-page failure.
  3. Retry after the page settles — transient navigation during evaluate is a common cause.
  4. Update the library if Upwork changed its Vuex store exposure; an outdated extractor script will throw in-page.
  5. Restart the browser/bridge if evaluation keeps failing on a healthy page.
Defensive patterns

Strategy: try-catch

Validate before calling

await page.goto(jobUrl, { waitUntil: 'networkidle' });
const hasStore = await page.evaluate(() => Boolean(document.querySelector('#app, [data-vuex], body') ) );
if (!page.url().includes('upwork.com')) throw new Error('Not on an Upwork page; open Upwork in the connected browser first');

Try / catch

try {
  const detail = await fetchUpworkJobDetail(id);
} catch (e) {
  if (e instanceof CommandExecutionError && /Failed to read Upwork job-detail store/.test(e.message)) {
    console.log('Open https://www.upwork.com in the connected browser, let the page fully load, then retry.');
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/77961d893f556a34. Report an issue: GitHub.