MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / chromeLaunchRemediation

Function chromeLaunchRemediation

packages/cli/src/browser/linuxDeps.ts:328–350  ·  view source on GitHub ↗
(errorMessage: string)

Source from the content-addressed store, hash-verified

326 * isn't a shared-library/launch failure this module can help with.
327 */
328export function chromeLaunchRemediation(errorMessage: string): string | undefined {
329 const isLaunchFailure =
330 /Failed to launch the browser process/i.test(errorMessage) ||
331 isSharedLibLaunchError(errorMessage);
332 if (!isLaunchFailure) return undefined;
333 if (process.platform !== "linux") return undefined;
334 // On Linux ARM64 the render browser is system Chromium (see
335 // ensureLinuxArmBrowser in manager.ts), so a launch failure there is almost
336 // always a missing/mis-pathed chromium — NOT the headless-shell .so set. The
337 // shared-lib install line would be wrong advice, so defer to that path's own
338 // guidance instead of emitting it here.
339 if (process.arch === "arm64") return undefined;
340
341 const distro = detectLinuxDistro();
342 const lines: string[] = [];
343 lines.push(
344 `Chrome could not launch on ${distroLabel(distro)} — this is almost always missing system libraries (e.g. libnss3).`,
345 );
346 lines.push("Install the Chrome headless dependencies:");
347 lines.push(` ${chromeDepsInstallCommand(distro.family)}`);
348 lines.push("Then verify with: npx hyperframes doctor");
349 return lines.join("\n");
350}

Callers 2

linuxDeps.test.tsFile · 0.85
handleRenderErrorFunction · 0.85

Calls 4

isSharedLibLaunchErrorFunction · 0.85
detectLinuxDistroFunction · 0.85
distroLabelFunction · 0.85
chromeDepsInstallCommandFunction · 0.85

Tested by

no test coverage detected