fix(install): auto-install Playwright Chromium + friendlier missing-browser error#107
Merged
Merged
Conversation
…rowser error User report: a fresh `npm install -g @decocms/parity` followed by `parity run` failed with `browserType.launch: Executable doesn't exist at .../chrome-headless-shell` plus Playwright's ASCII banner. Two fixes: 1. **postinstall script** runs `npx playwright install chromium` automatically after install (one-time, ~140 MB). Skippable via `PARITY_SKIP_PLAYWRIGHT_INSTALL=1` for CI / Docker / monorepos that manage browsers separately. Failures (offline, corp proxy) downgrade to a warning so the global install itself still completes. 2. **launchBrowser catches the missing-browser error** and throws a new Error with a single clear instruction (`npx playwright install chromium`) instead of letting Playwright's stack trace + banner reach the user. Original error preserved on `.cause`. Also documented the known cosmetic peer-dep warning for zod (SDK wants zod 4, parity uses zod 3 — they coexist via npm nesting, harmless). Bumps 0.11.7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User report after
npm install -g @decocms/parity@latest:parity runfailed withbrowserType.launch: Executable doesn't exist+ Playwright's ASCII banner.Two fixes:
npx playwright install chromiumautomatically. Skippable viaPARITY_SKIP_PLAYWRIGHT_INSTALL=1. Failures downgrade to warning.Bumps 0.11.7.
Summary by cubic
Automatically installs Playwright Chromium during
@decocms/parityinstall. Replaces the "Executable doesn't exist" crash with a clear instruction to fix first-run failures after a fresh global install.postinstallscript to runnpx playwright install chromiumonce; skip withPARITY_SKIP_PLAYWRIGHT_INSTALL=1. Failures log a warning so install still completes.launchBrowsernow catches the missing-browser error and shows a single instruction (npx playwright install chromium), preserving the original error oncause.Written for commit 7fe2f0f. Summary will update on new commits.