* A Chrome binary can exist on disk yet be unlaunchable because its system * shared libraries (libnss3, libatk, ...) aren't installed — the dominant WSL * first-render failure. When that's the case, downgrade the "found" outcome to * a render-blocking error carrying the exact per-distro install c
( executablePath: string, found: EnvironmentCheckOutcome, )
| 134 | * `ldd` can't run (probe inconclusive). |
| 135 | */ |
| 136 | function chromeSharedLibOutcome( |
| 137 | executablePath: string, |
| 138 | found: EnvironmentCheckOutcome, |
| 139 | ): EnvironmentCheckOutcome { |
| 140 | if (process.platform !== "linux") return found; |
| 141 | const probe = probeChromeSharedLibs(executablePath); |
| 142 | if (probe.probeUnavailable || probe.ok) return found; |
| 143 | |
| 144 | const distro = detectLinuxDistro(); |
| 145 | return { |
| 146 | name: "Chrome", |
| 147 | ok: false, |
| 148 | level: "error", |
| 149 | title: "Chrome cannot launch (missing system libraries)", |
| 150 | detail: `Chrome at ${executablePath} is missing shared libraries on ${distroLabel(distro)}: ${probe.missing.join(", ")}`, |
| 151 | hint: chromeDepsInstallCommand(distro.family), |
| 152 | path: executablePath, |
| 153 | }; |
| 154 | } |
| 155 | |
| 156 | async function checkChrome(browserPath?: string): Promise<EnvironmentCheckOutcome> { |
| 157 | if (browserPath) { |
no test coverage detected