santifer/career-ops · warning

archive render skipped — no Playwright browser in env

Error message

archive render skipped — no Playwright browser in env

What it means

The archive-render test needs a Playwright Chromium browser; it checks `existsSync(chromium.executablePath())` after importing playwright. When either the import fails or the browser binary is absent, it warns that the archive render test is skipped instead of failing.

Solutions

  1. Run `npx playwright install chromium` to download the browser binary.
  2. If the npm package itself is missing, run `npm install` first, then the browser install.
  3. In CI, cache the browsers directory and run playwright install as a setup step.
  4. Accept the skip for local runs where you never exercise archive rendering.

Example fix

// before
- run: npm test
// after
- run: npx playwright install chromium
- run: npm test
Defensive patterns

Strategy: fallback

Validate before calling

let ok = false; try { const { chromium } = await import('playwright'); ok = existsSync(chromium.executablePath()); } catch {} if (!ok) console.warn('run: npx playwright install chromium');

Type guard

const browserReady = async () => { try { const { chromium } = await import('playwright'); return existsSync(chromium.executablePath()); } catch { return false; } };

Try / catch

try { const { chromium } = await import('playwright'); if (!existsSync(chromium.executablePath())) throw new Error('browser missing'); } catch { warn('skipping render test — install browsers with npx playwright install'); }

Prevention

When it happens

Trigger: `import('playwright')` rejects (package not installed), or playwright is installed but `chromium.executablePath()` points to a non-existent path (browsers never downloaded via `npx playwright install`).

Common situations: Fresh CI containers that installed the playwright npm package but skipped `playwright install`, machines where browsers were cleaned from the cache (~/Library/Caches/ms-playwright), or a Playwright version upgrade that expects a different browser build.

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


AI-assisted analysis of santifer/career-ops@e7abd431fc (2026-09-16). Data as JSON: /api/errors/40466d4c28b6bac8. Report an issue: GitHub.

Appendix: source

Thrown at test-all.mjs:7122

  : fail('no --report: filename shape regressed');

run(NODE, ['archive-posting.mjs', '--dry-run', '--report=abc', 'https://boards.greenhouse.io/openai/jobs/123']) === null
  ? pass('--report with non-numeric value: exits non-zero')
  : fail('--report with non-numeric value: should be rejected, not ignored');

run(NODE, ['archive-posting.mjs', '--pipeline', '--report=42']) === null
  ? pass('--report with --pipeline: rejected (report keys one posting)')
  : fail('--report with --pipeline: should exit non-zero');

// live render: gated behind Playwright executable availability
let hasBrowser = false;
try {
  const { chromium } = await import('playwright');
  hasBrowser = existsSync(chromium.executablePath());
} catch { /* playwright not installed */ }

if (!hasBrowser) {
  warn('archive render skipped — no Playwright browser in env');
} else {
  let liveJobUrl = null;
  try {
    const res = await fetch('https://boards-api.greenhouse.io/v1/boards/anthropic/jobs?content=false');
    const { jobs } = await res.json();
    const candidate = jobs?.[0]?.absolute_url ?? null;
    if (candidate) {
      const u = new URL(candidate);
      const allowed = new Set(['boards.greenhouse.io', 'job-boards.greenhouse.io']);
      if (u.protocol === 'https:' && allowed.has(u.hostname)) liveJobUrl = candidate;
    }
  } catch { /* offline — degrade gracefully */ }

  if (!liveJobUrl) {
    warn('archive render skipped — Greenhouse API unreachable');
  } else {
    const JDS_DIR = join(ROOT, 'jds');
    const startedAt = Date.now();

View on GitHub (pinned to e7abd431fc)