Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome launcher wont launch #294

Open
fotoflo opened this issue Mar 20, 2023 · 1 comment
Open

Chrome launcher wont launch #294

fotoflo opened this issue Mar 20, 2023 · 1 comment

Comments

@fotoflo
Copy link

fotoflo commented Mar 20, 2023

Hi guys I'm using node to run lighthouse and chrome launcher wont launch in my dev env (mac)

Any idea whats up? or at least how to debug it?

It seems like there's something wrong with the dependency - (but typescript compiles)

i think maybe it cant find chrome?

import ChromeLauncher from "chrome-launcher";

const chromeOptions = {
  chromeFlags: ["--headless", "--disable-gpu"],
};

async function launchChrome() {
  try {
    const chrome = await ChromeLauncher.launch(chromeOptions);
    console.log("chrome running!");
    return chrome;
  } catch (e) {
    console.log("**** Chrome failed to launch", e);
    debugger; // always land here.
    throw e;
  }
}

**** Chrome failed to launch TypeError: Cannot read properties of undefined (reading 'launch')
at launchChrome (webpack-internal:///(api)/./src/server/reporting/lighthouseRunner.ts:35:84)

I tried:

  1. Adding this to my env CHROME_PATH="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
  2. I used the chrome path option
  3. adding and removing chrome-launcher from package.json dependancies
    "chrome-launcher": "^0.15.1",
    ... More

I created a stack overflow question for this too - https://stackoverflow.com/questions/75796888/chrome-launcher-fails-to-launch-chrome

@Assy-cmd

This comment was marked as resolved.

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

No branches or pull requests

2 participants