Skip to content

fix(install): auto-install Chromium at runtime when postinstall skipped#110

Merged
JonasJesus42 merged 1 commit into
mainfrom
fix/lazy-chromium-install
Jun 17, 2026
Merged

fix(install): auto-install Chromium at runtime when postinstall skipped#110
JonasJesus42 merged 1 commit into
mainfrom
fix/lazy-chromium-install

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The 0.11.7 postinstall hook works when npm runs it, but plenty of installs skip lifecycle scripts (ignore-scripts=true, npm 11+ default for global installs, monorepos with --ignore-scripts). Result: users saw the friendly "run npx playwright install chromium" message but still had to run a second command before parity worked.
  • Now launchBrowser catches the missing-browser error and runs npx --yes playwright install chromium inline with stdio inherited (so the download progress is visible), then retries the launch once.
  • The explicit-opt-out path is preserved via PARITY_SKIP_PLAYWRIGHT_INSTALL=1 for CI / Docker / monorepos that want strict control.
  • Bumps to 0.11.10. No manual gh release create — the Publish workflow owns it.

Test plan

  • bun run check clean
  • bun run test — 701/701 pass
  • After merge: npm i -g @decocms/parity@latest && parity run --preset smoke … works in one command on a fresh machine without a separate npx playwright install chromium

🤖 Generated with Claude Code


Summary by cubic

Automatically installs Chromium at runtime when Playwright’s binary is missing because install scripts were skipped. This lets parity run in one command on fresh machines and global installs.

  • Bug Fixes
    • In launchBrowser, detect missing Chromium and run npx --yes playwright install chromium with inherited stdio, then retry once.
    • Respect PARITY_SKIP_PLAYWRIGHT_INSTALL=1 to opt out for CI/Docker.
    • Show a clear error with the manual command if the auto-install fails.

Written for commit 182153b. Summary will update on new commits.

Review in cubic

The 0.11.7 postinstall hook works when npm actually runs it, but plenty
of installs skip lifecycle scripts (npm config ignore-scripts=true, npm
11+ default for global installs, monorepos with --ignore-scripts).
Users got a friendly "run npx playwright install chromium" message but
still had to run a second command before parity worked.

Now launchBrowser catches the missing-browser error and runs
`npx --yes playwright install chromium` inline with stdio inherited so
the download progress is visible, then retries the launch once. The
explicit-opt-out path is preserved via PARITY_SKIP_PLAYWRIGHT_INSTALL=1
for CI / Docker / monorepos that want strict control.

Net effect: a fresh `npm i -g @decocms/parity && parity run …` works
in one command even when lifecycle scripts are disabled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@JonasJesus42 JonasJesus42 merged commit 2b50b13 into main Jun 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant