GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.26k stars 9.35k forks source link

"Opportunities" no longer surfaced in report or in resulting output in Lighthouse 12 #15977

Closed adamhenson closed 5 months ago

adamhenson commented 5 months ago

FAQ

URL

https://www.google.com

What happened?

I ran Lighthouse via both CLI and programmatically with basic examples below:

CLI

lighthouse https://www.google.com

Programmatic

const { lhr: result } = await lighthouse('https://www.google.com');

In both these examples I expect to opportunities to be represented the same way they were in Lighthouse v11, as there was no mention of this in the changelog.

What did you expect?

  1. I expected to see an "Opportunities" section in the HTML report.

    Lighthouse 11.5

    Screenshot 2024-04-27 at 10 59 13 AM
  2. I expected to see an result.opportunities array in the resulting programmatic output.

What have you tried?

No response

How were you running Lighthouse?

CLI, node

Lighthouse Version

12.0.0

Chrome Version

123.0.6312.106

Node Version

18.20.2

OS

MAc

Relevant log output

No response

paulirish commented 5 months ago

We're pretty sure the "opportunities" label went away in v11.2.0 (or maybe the next release).

Haven't verified but really surprised if its there in 11.5 :)

Also fwiw, there's not a results.opportunities and never has been. It's been defined via something like this:

image

paulirish commented 5 months ago

Here's the release notes for when we took out Opportunities. https://github.com/GoogleChrome/lighthouse/releases/tag/v11.2.0 it doesn't call it out.. and probably should. That's true. :)

Stay cool, b.

adamhenson commented 5 months ago

Hey @paulirish - thanks for responding. Ahhhh yes, you got me there. I actually manually typed Lighthouse result for some reason in @foo-software/lighthouse-persist... but forgot that type includes the addition of opportunities that I added. Sorry about that. Not sure why my function broke in this new version of Lighthouse, but that's my problem.

I mainly wanted to find out if the sans opportunities (in the report) was intended, which you confirmed.

Thanks again.

adamhenson commented 5 months ago

I also forgot that in my code somewhere I hijack the report rendering and must be somehow including opportunities 🤦 - sorry again. That's where I got the Lighthouse 11.5.0 report.

paulirish commented 5 months ago

No worries! :)