{"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":2025,"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":2007,"sourceCodeEnd":2043,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/scan.mjs#L2007-L2043","documentation":"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).","triggerScenarios":"Running `scan.mjs --verify` where import('playwright') rejects — package absent from node_modules, resolution path broken, or an incompatible Node/Playwright version pair.","commonSituations":"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.","solutions":["Install playwright: npm install playwright.","Re-run without --verify if liveness verification is not required.","Confirm resolution: node -e \"import('playwright').then(m => console.log(typeof m.chromium))\".","In Docker, add a RUN npm install playwright && npx playwright install chromium layer."],"exampleFix":"# before\nnode scan.mjs --verify\n\n# after\nnpm install playwright && npx playwright install chromium\nnode scan.mjs --verify","handlingStrategy":"validation","validationCode":"async function ensurePlaywrightInstalled() {\n  try { await import('playwright'); }\n  catch (e) { throw new Error('--verify needs playwright: npm install playwright'); }\n}\nif (opts.verify) await ensurePlaywrightInstalled();","typeGuard":null,"tryCatchPattern":"try {\n  await runVerifiedScan();\n} catch (err) {\n  if (err.message.includes('requires Playwright')) {\n    console.error(`${err.message}\\nRetrying without --verify.`);\n    opts.verify = false;\n    await runScan();\n  } else throw err;\n}","preventionTips":["Pre-flight check playwright importability before launching a long scan with --verify.","Keep playwright as a non-optional dep in environments that use --verify.","Provide a graceful --verify fallback path in your wrapper."],"tags":["playwright","verify","dynamic-import","dependencies","scan"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}