santifer/career-ops · error · Error

--verify requires Playwright with Chromium (run "npx playwri

Error message

--verify requires Playwright with Chromium (run "npx playwright install chromium"): ${err.message}

What it means

scan.mjs's --verify path dynamically imports 'playwright' and './liveness-browser.mjs'. If the import fails (playwright package missing or unresolvable), it throws an Error with the underlying cause and an install hint. This is the import-failure twin of error 349 (which covers the launch failure).

Source

Thrown at scan.mjs:2025

  return results;
}

// ── Main ────────────────────────────────────────────────────────────

async function verifyOffers(offers, { headedFallback = false, throttleBaseMs = 0, rediscover = false } = {}) {
  // Dynamic imports keep the default zero-token path free of Playwright startup
  let chromium;
  let checkUrlLiveness;
  let checkUrlLivenessWithFallback;
  let createHeadedPageProvider;
  let newLivenessPage;
  let jitteredDelayMs;
  let sleep;
  try {
    ({ chromium } = await import('playwright'));
    ({ checkUrlLiveness, checkUrlLivenessWithFallback, createHeadedPageProvider, newLivenessPage, jitteredDelayMs, sleep } = await import('./liveness-browser.mjs'));
  } catch (err) {
    throw new Error(
      `--verify requires Playwright with Chromium (run "npx playwright install chromium"): ${err.message}`,
      { cause: err },
    );
  }

  let browser;
  try {
    browser = await chromium.launch({ headless: true });
  } catch (err) {
    throw new Error(
      `--verify could not launch Chromium (run "npx playwright install chromium" or re-run without --verify): ${err.message}`,
      { cause: err },
    );
  }

  // Three permanent buckets + one transient passthrough:
  //   verified  → active pages and transient nav errors (retry next scan)
  //   expired   → classifier-confirmed dead postings (HTTP 4xx, redirect markers,

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Install playwright: npm install playwright.
  2. Re-run without --verify if liveness verification is not required.
  3. Confirm resolution: node -e "import('playwright').then(m => console.log(typeof m.chromium))".
  4. In Docker, add a RUN npm install playwright && npx playwright install chromium layer.

Example fix

# before
node scan.mjs --verify

# after
npm install playwright && npx playwright install chromium
node scan.mjs --verify
Defensive patterns

Strategy: validation

Validate before calling

async function ensurePlaywrightInstalled() {
  try { await import('playwright'); }
  catch (e) { throw new Error('--verify needs playwright: npm install playwright'); }
}
if (opts.verify) await ensurePlaywrightInstalled();

Try / catch

try {
  await runVerifiedScan();
} catch (err) {
  if (err.message.includes('requires Playwright')) {
    console.error(`${err.message}\nRetrying without --verify.`);
    opts.verify = false;
    await runScan();
  } else throw err;
}

Prevention

When it happens

Trigger: Running `scan.mjs --verify` where import('playwright') rejects — package absent from node_modules, resolution path broken, or an incompatible Node/Playwright version pair.

Common situations: New clone without npm install; CI image that omits playwright; optional-dependency not installed in a minimal install; workspace hoisting leaves playwright only in a sibling package.

Related errors


AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13). Data as JSON: /api/errors/ea6aca56610ad13c. Report an issue: GitHub.