fix(server): stop misdiagnosing missing shared libs as missing Chromium - #746
Merged
divshekhar merged 5 commits intoSep 5, 2026
Merged
Conversation
Add chromiumInstallDepsCommand alongside the existing chromiumInstallCommand, pinned to the bundled playwright version for the same reason the install command is: an unpinned npx can resolve a different playwright than the one the daemon bundles. Prep for the playwright-launcher fix in the next commit (reticlehq#691). Signed-off-by: Som <Som.samantray@gmail.com>
playwrightLauncher's catch-all regex (executable doesn't exist | playwright install | browsertype\.launch) matches almost any launch failure, because Playwright prefixes nearly all of them with browserType.launch. That includes the distinct "Host system is missing dependencies to run browsers" failure (missing OS shared libraries such as libnspr4.so), which was rewritten to the missing-binary hint telling the user to run `npx playwright install chromium` — a command that succeeds and fixes nothing, since the binary was never missing. Add a narrower check for that message, checked first, that points at `install-deps` instead. Covered by a test that reproduces the wrong hint on current code (RED) before the fix, plus a regression test for the untouched missing-binary case. This addresses one of the sub-symptoms reported in reticlehq#691 (the shared-library misdiagnosis); the other reported sub-symptoms (Windows package-not-installed wording, post-install build mismatch, headed-vs-headless-only Windows failures) are out of scope for this change and are not fixed by it. Refs reticlehq#691 Signed-off-by: Som <Som.samantray@gmail.com>
Follow-up to the previous commit: chromiumInstallCommand and chromiumInstallDepsCommand had identical pin-or-unpinned logic, differing only in the playwright subcommand. Extract it into a small private helper. Signed-off-by: Som <Som.samantray@gmail.com>
pnpm format:check flagged a double-quoted string prettier wants single-quoted. No behavior change. Signed-off-by: Som <Som.samantray@gmail.com>
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.
What & why
Refs #691. That issue bundles four distinct misdiagnoses in Reticle's pooled-lease
Chromium launch path. This PR fixes one of them — the rest are out of scope here
and remain open on the issue:
libnspr4.so) is misreported as "Chromium is not installed."build/version mismatch, and headed-vs-headless-only failures on Windows. Those have
unverified root causes and are separate follow-up work.
playwrightLauncher()inpackages/server/src/pool/playwright-launcher.tscatches everychromium.launchfailure with one regex(
/executable doesn.?t exist|playwright install|browsertype\.launch/i). Playwrightprefixes almost every launch error with
browserType.launch:, so that regex also matchesPlaywright's distinct "Host system is missing dependencies to run browsers" failure — the
browser binary is present, but the host's shared libraries are not. Users hitting that case
were told to run
npx playwright install chromium, which succeeds and fixes nothing,because the binary was never missing.
This adds a narrower check for that message, checked before the generic one, that
points at
npx playwright install-deps chromiuminstead — pinned to the daemon's bundledplaywright version the same way the existing hint already is. A new
chromiumInstallDepsCommandsits next to the existingchromiumInstallCommandinchromium-hint.ts, sharing a small internal pin helper.Authored with AI pair-programming assistance (Claude Code) and reviewed by a human
before submission.
How it was verified
main: a mockedchromium.launchrejection carrying Playwright's real "Host system is missing dependencies to run
browsers" message was, before this fix, rewritten into the missing-binary hint (RED).
After the fix it correctly names
install-depsand no longer mentions themissing-binary hint (GREEN).
and a test confirming an unrelated launch failure is still rethrown as-is.
chromiumInstallDepsCommand, mirroring the existingchromiumInstallCommandcoverage (pinned and unpinned cases).pnpm --filter @reticlehq/server exec vitest runon the two changed test files:16/16 passing.
pnpm --filter @reticlehq/server run typecheck: clean.eslintrun directly against the four changed source/test files (the full monorepopnpm lint— which also builds/lints every fixture app — timed out in the sandbox thisPR was prepared in; the scoped run against the changed files is clean, and CI runs the
full gate regardless).
Gates run
pnpm lint && pnpm typecheck && pnpm test:unit(~2 min — always) — run inpackage/file-scoped form locally (see verification notes above); CI runs the
full monorepo command.
pnpm test:e2e(~8 min) — not touched (no tool surface,packages/core, observer,or telemetry change)
pnpm gate:install(~15 min) — not touched (noinit/vite-plugin/next/babel-pluginchange)pnpm test:e2e:desktop(~3 min) — not touched (no electron/tauri/desktop-capturechange)
Checklist
git commit -s)without it
any, no free strings, no non-null!console.logor internal tracking codes left in the diffCHANGELOG.mdupdated under[Unreleased]→### Fixed(user-facing behaviorchange)