GoogleChrome / lighthouse-ci

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions
Apache License 2.0
6.41k stars 644 forks source link

chore: update lighthouse version to 10.0.2 #890

Closed dbrenot-pelmorex closed 1 year ago

dbrenot-pelmorex commented 1 year ago

Fixes issues when running lighthouse cli in our organization. Lighthouse cli crashes

lin-brian-l commented 1 year ago

@paulirish just wanted to check in, is there a projected time for this being merged and released? We're also being impacted by the "Cannot create new tab" issue and wanted to know whether we should wait on this fix or investigate a workaround.

chaimabg commented 1 year ago

@paulirish, I just wanted to check, when will be the merge of this PR?

izi-p commented 1 year ago

Hi, any updates on this? 👀

mpolakov commented 1 year ago

Updating only lighthouse version won't work. I've tried to npm override dependency for the lighthouse dependency and it's failing on this line: https://github.com/GoogleChrome/lighthouse-ci/blob/main/packages/cli/src/collect/node-runner.js#L15

The reason is that Lighthouse dependency has changed the folder hierarchy from "lighthouse-cli/index.js" to: "cli/index.js". In general they get rid of "lighthouse-" prefix. Not sure whether some other compatibility issues are presented, however this is the first one blocking it. More what has been updated in major version of the lighthouse: https://github.com/GoogleChrome/lighthouse/releases/tag/v10.0.0

Reference from package.json of https://www.npmjs.com/package/lighthouse/v/10.0.2

"name": "lighthouse",
  "type": "module",
  "version": "10.0.2",
  "description": "Automated auditing, performance metrics, and best practices for the web.",
  "main": "./core/index.js",
  "bin": {
    "lighthouse": "./cli/index.js",
    "chrome-debug": "./core/scripts/manual-chrome-launcher.js",
    "smokehouse": "./cli/test/smokehouse/frontends/smokehouse-bin.js"
  },
  "engines": {
    "node": ">=16.16"
  },
Poojak-13 commented 1 year ago

Hi Team, Any update about the merge timeline ?? By when it will get merged as it is impacting us . A version upgrade merge is taking so much time

tniezurawski commented 1 year ago

It looks like it has a surprisingly low priority. Did anyone fork the repo and made the changes that @mpolakov mentioned?

mpolakov commented 1 year ago

It looks like it has a surprisingly low priority. Did anyone fork the repo and made the changes that @mpolakov mentioned?

If you're using Github actions, then I temporary fixed it by installing specific version of the chrome. Using: browser-actions/setup-chrome@v1 and chrome version that is working: 999338.

No fork from my side as I am still hoping that the owner of the repository will make the upgrade.

tniezurawski commented 1 year ago

Thanks @mpolakov but that didn't work for me unfortunately:

image

Do you see anything wrong with my config?

runs-on: ubuntu-latest
steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-node@v3
    with:
      node-version-file: '.nvmrc'
  - uses: browser-actions/setup-chrome@v1
    with:
      chrome-version: 999338
    id: setup-chrome
  - run: |
      echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
      chrome --version
  - name: npm install
    run: |
      npm install
  - name: run Lighthouse CI
    run: |
      npm install -g @lhci/cli@0.11.x
      CHROMIUM_BIN=$(which chrome) lhci autorun --config=lighthouserc.js --upload.target=temporary-public-storage
jb-0 commented 1 year ago

Thanks @mpolakov but that didn't work for me unfortunately:

image

Do you see anything wrong with my config?

runs-on: ubuntu-latest
steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-node@v3
    with:
      node-version-file: '.nvmrc'
  - uses: browser-actions/setup-chrome@v1
    with:
      chrome-version: 999338
    id: setup-chrome
  - run: |
      echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
      chrome --version
  - name: npm install
    run: |
      npm install
  - name: run Lighthouse CI
    run: |
      npm install -g @lhci/cli@0.11.x
      CHROMIUM_BIN=$(which chrome) lhci autorun --config=lighthouserc.js --upload.target=temporary-public-storage

@tniezurawski setting the CHROME_PATH env var worked for me, so something like:

- name: run Lighthouse CI
  run: |
    npm install -g @lhci/cli@0.11.x
    CHROMIUM_BIN=$(which chrome) lhci autorun --config=lighthouserc.js --upload.target=temporary-public-storage
  env:
    CHROME_PATH: /opt/hostedtoolcache/chromium/999338/x64/chrome
tniezurawski commented 1 year ago

@mpolakov That was the missing part! Thank you 🙌

spencercarr commented 1 year ago

We had similar issue at our org, found the fix after some time.

  1. Use chromePath not executablePath in config
  2. Lock the puppeteer version to 19.6.3 (< chrome 111) https://github.com/puppeteer/puppeteer/blob/main/docs/chromium-support.md
  3. Local runs: chromePath = require ('puppeteer').getExecutablePath()
  4. Docker runs: chromePath = alpine chromium
paulirish commented 1 year ago

Sorry for the recent challenges folks. We've got a release on the way to sort these issues out. Appreciate your patience thus far.

PR to bump LH to 10.x: https://github.com/GoogleChrome/lighthouse-ci/pull/899

I'm closing this PR in favor of that one.