{"record":{"id":"ea6aca56610ad13c","repo":"santifer/career-ops","slug":"verify-requires-playwright-with-chromium-run-n","errorCode":null,"errorMessage":"--verify requires Playwright with Chromium (run \"npx playwright install chromium\"): ${err.message}","messagePattern":"--verify requires Playwright with Chromium \\(run \"npx playwright install chromium\"\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scan.mjs","lineNumber":2691,"sourceCode":"  return results;\n}\n\n// ── Main ────────────────────────────────────────────────────────────\n\nasync function verifyOffers(offers, { headedFallback = false, throttleBaseMs = 0, rediscover = false } = {}) {\n  // Dynamic imports keep the default zero-token path free of Playwright startup\n  let chromium;\n  let checkUrlLiveness;\n  let checkUrlLivenessWithFallback;\n  let createHeadedPageProvider;\n  let newLivenessPage;\n  let jitteredDelayMs;\n  let sleep;\n  try {\n    ({ chromium } = await import('playwright'));\n    ({ checkUrlLiveness, checkUrlLivenessWithFallback, createHeadedPageProvider, newLivenessPage, jitteredDelayMs, sleep } = await import('./liveness-browser.mjs'));\n  } catch (err) {\n    throw new Error(\n      `--verify requires Playwright with Chromium (run \"npx playwright install chromium\"): ${err.message}`,\n      { cause: err },\n    );\n  }\n\n  let browser;\n  try {\n    browser = await chromium.launch({ headless: true });\n  } catch (err) {\n    throw new Error(\n      `--verify could not launch Chromium (run \"npx playwright install chromium\" or re-run without --verify): ${err.message}`,\n      { cause: err },\n    );\n  }\n\n  // Three permanent buckets + one transient passthrough:\n  //   verified  → active pages and transient nav errors (retry next scan)\n  //   expired   → classifier-confirmed dead postings (HTTP 4xx, redirect markers,","sourceCodeStart":2673,"sourceCodeEnd":2709,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/scan.mjs#L2673-L2709","documentation":"scan.mjs's --verify path dynamically imports playwright and liveness-browser.mjs; when that import throws, the library wraps it in this error to say Chromium support is required. The original failure is preserved as `cause`.","triggerScenarios":"Running the scanner with --verify when the playwright package cannot be resolved (not installed) or liveness-browser.mjs cannot be loaded, or the playwright package loads but fails at import time due to version incompatibility.","commonSituations":"New environment where `npx playwright install chromium` was skipped; node_modules pruned; running via npx from a directory without playwright installed; Node runtime mismatch with the Playwright install.","solutions":["Run `npx playwright install chromium`","Install the dependency: `npm install playwright` (project-local, not global-only)","Verify `node -e \"import('playwright')\"` resolves without error","Re-run without --verify to skip browser-based verification"],"exampleFix":"// before\nnode scan.mjs --verify          # Error: --verify requires Playwright with Chromium\n// after\nnpm install playwright && npx playwright install chromium\nnode scan.mjs --verify","handlingStrategy":"fallback","validationCode":"async function canVerify() {\n  try { await import('playwright'); return true; } catch { return false; }\n}\nconst args = canVerify() ? ['--verify'] : [];","typeGuard":null,"tryCatchPattern":"try {\n  await scanWithVerify(opts);\n} catch (err) {\n  if (err.message.includes('--verify requires Playwright')) {\n    console.warn('Falling back to scan without --verify:', err.cause?.message);\n    return scanWithoutVerify(opts);\n  }\n  throw err;\n}","preventionTips":["Document that --verify is an opt-in browser feature requiring `npx playwright install chromium`","Detect Playwright availability once at startup and strip --verify with a warning","Keep playwright and browsers installed in the same Docker image as the app"],"tags":["playwright","missing-dependency","verify","cli"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}