santifer/career-ops · error · Error
--verify requires Playwright with Chromium (run "npx…
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; when that import throws, the library wraps it in this error to say Chromium support is required. The original failure is preserved as `cause`.
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
Example fix
// before node scan.mjs --verify # Error: --verify requires Playwright with Chromium // after npm install playwright && npx playwright install chromium node scan.mjs --verify
Defensive patterns
Strategy: fallback
Validate before calling
async function canVerify() {
try { await import('playwright'); return true; } catch { return false; }
}
const args = canVerify() ? ['--verify'] : []; Try / catch
try {
await scanWithVerify(opts);
} catch (err) {
if (err.message.includes('--verify requires Playwright')) {
console.warn('Falling back to scan without --verify:', err.cause?.message);
return scanWithoutVerify(opts);
}
throw err;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "X is not installed. Please install it with pip install Y": missing optional dependency errors — ImportError/ValueError raised when a library's optional extra was never installed — this error's family across 22 libraries.
Related errors
- --liveness requires Playwright with Chromium (run "npx…
- Application Answers section has
- archive render skipped — no Playwright browser in env
- requires a path
- Blocked request to restricted destination (DNS)
AI-assisted analysis of santifer/career-ops@e7abd431fc (2026-09-16).
Data as JSON: /api/errors/ea6aca56610ad13c.
Report an issue: GitHub.
Appendix: source
Thrown at scan.mjs:2691
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 e7abd431fc)