{"record":{"id":"9ceb89b61cbe7a54","repo":"santifer/career-ops","slug":"verify-could-not-launch-chromium-run-npx-playw","errorCode":null,"errorMessage":"--verify could not launch Chromium (run \"npx playwright install chromium\" or re-run without --verify): ${err.message}","messagePattern":"--verify could not launch Chromium \\(run \"npx playwright install chromium\" or re-run without --verify\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scan.mjs","lineNumber":2035,"sourceCode":"  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,\n  //               body patterns, listing pages, insufficient content)\n  //   dropped   → page loaded but classifier saw no Apply control. --verify is an\n  //               opt-in stricter filter; keeping these defeats the purpose.\n  //   invalid   → up-front URL guard rejections (malformed / non-http / private)\n  const verified = [];\n  const expired = [];\n  const dropped = [];\n  const invalid = [];\n  const migrated = [];\n","sourceCodeStart":2017,"sourceCodeEnd":2053,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/scan.mjs#L2017-L2053","documentation":"After the playwright module imports successfully, scan.mjs calls chromium.launch({ headless: true }). If launching the browser process fails (no Chromium binary on disk, sandbox/permission error, missing system libraries), it throws an Error with a cause. This is distinct from error 348: the npm package is present, but the browser executable is not.","triggerScenarios":"playwright npm package is installed but the Chromium browser binary has not been downloaded via `npx playwright install chromium`; system shared libraries missing (libnss3, libatk, etc.); a sandbox/permissions error in CI containers running as root without --no-sandbox.","commonSituations":"CI/CD pipeline that runs npm install but skips playwright install; a Docker image missing OS deps; headless Linux server without libnss3; running as root in a container where Chromium refuses to launch without flags.","solutions":["Download the Chromium binary: npx playwright install chromium.","Install OS dependencies: npx playwright install-deps chromium (Debian/Ubuntu) or install libnss3, libatk1.0, libatk-bridge2.0, libcups2, libxkbcommon0 manually.","If running as root in a container, configure launch args: chromium.launch({ headless: true, args: ['--no-sandbox'] }) — or set PLAYWRIGHT_CHROMIUM_ARGS.","Re-run without --verify to bypass the browser path."],"exampleFix":"# before: package installed but no browser binary\nnode scan.mjs --verify  # -> could not launch Chromium\n\n# after\nnpx playwright install chromium\nnode scan.mjs --verify","handlingStrategy":"try-catch","validationCode":"async function chromiumIsLaunchable() {\n  try {\n    const { chromium } = await import('playwright');\n    const b = await chromium.launch({ headless: true });\n    await b.close();\n    return true;\n  } catch { return false; }\n}\nif (opts.verify && !(await chromiumIsLaunchable())) {\n  throw new Error('Chromium not launchable. Run: npx playwright install chromium');\n}","typeGuard":null,"tryCatchPattern":"try {\n  browser = await chromium.launch({ headless: true });\n} catch (err) {\n  if (err.message.includes('could not launch Chromium')) {\n    console.error(err.message);\n    process.exitCode = 3;\n    return;\n  }\n  throw err;\n}","preventionTips":["Add `npx playwright install chromium` to your CI setup and Dockerfile.","Install OS deps: npx playwright install-deps chromium on Debian/Ubuntu.","In root containers, pass { args: ['--no-sandbox'] } to chromium.launch."],"tags":["playwright","chromium","browser-launch","dependencies","scan","ci"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}