GoogleChrome / lighthouse

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

"Show audits relevant to" not shown on report from PageSpeed Insights API #16169

Closed lasseschou closed 2 months ago

lasseschou commented 2 months ago

FAQ

URL

https://googlechrome.github.io/lighthouse/viewer/

What happened?

When fetching a Lighthouse report via the PageSpeed Insights API (https://www.googleapis.com/pagespeedonline/v5/runPagespeed), and then paste the resulting report into the Lighthouse Report Viewer (https://googlechrome.github.io/lighthouse/viewer/), I don't see the "Show audits relevant to" option.

When further debugging the JSON files, I can see that "normal" JSON reports have the metricSavings object directly in the audit object, but the JSON report from the PageSpeed Insights API has the metricSavings under details.debugData - and I guess this is the reason why the report viewer doesn't show that info.

What did you expect?

I expected the "Show metrics relevant to" to be available on Lighthouse reports fetched from the PageSpeed Insights API.

What have you tried?

I have tried to explain this under "what happened", but I found out that the JSON schema of the regular Lighthouse software (version 12.0.0), run in a Node.js environment, is slighty different than the JSON schema of the PageSpeed Insights API, even though it's the same Lighthouse version (12.0.0).

More specifically, the metricSavings object is normally directly under the audit object, where the PSI API places it under .details.debugData.metricSavings.

How were you running Lighthouse?

node, PageSpeed Insights

Lighthouse Version

12.0.0

Chrome Version

No response

Node Version

No response

OS

No response

Relevant log output

No response

connorjclark commented 2 months ago

Confirmed, investigating now. Thanks for the bug report!

connorjclark commented 2 months ago

The fix for this should roll out sometime today.

connorjclark commented 2 months ago

Confirmed fix.