GoogleChrome / lighthouse

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

Lighthouse audit always return warning 'Missing source maps for large first-party JavaScript' #14967

Open danurahadi opened 1 year ago

danurahadi commented 1 year ago

FAQ

URL

https://sportz.picassorewards.com:8443/login

What happened?

I face an issue of Chrome Lighthouse Audit.

I build a web app that loads Sock JS minified file.

The file is -> https://unpkg.com/sockjs-client@1.5.0/dist/sockjs.min.js

As you can see, there is //# sourceMappingURL at the end of the file.

Also, there is the source map file -> https://unpkg.com/sockjs-client@1.5.0/dist/sockjs.min.js.map

What did you expect?

I think that warning should not appear.

What have you tried?

I have tried to load the SockJS minified file from the CDN and do the Lighthouse Audit several times, but it's still produce the same warning :

Missing source maps for large first-party JavaScript

Environment :

Am I missing something here or there is a bug in the Lighthouse?

Thank you.

How were you running Lighthouse?

Chrome DevTools

Lighthouse Version

10.0.1

Chrome Version

112.0.5615.49

Node Version

No response

OS

Linux Ubuntu 22.04

Relevant log output

No response

adamraine commented 1 year ago

I don't think sockjs.min.js is causing the audit to fail, it's the other script (https://sportz.picassorewards.com:8443/_nuxt/entry.86f859b9.js) which doesn't have a source map. Are you seeing that as well?

I did also notice another error while testing your page though:

Screenshot 2023-04-14 at 2 36 16 PM

@alexnj can you investigate?

danurahadi commented 1 year ago

@adamraine I'm not sure about the script you mention because it's generated by Nuxt.js. And also that error message (screenshot) didn't show up on my local machine.

Maybe you Chrome guys can see the audit results from my local machine below :

lighthouse-audit

Thanks so much for your response.

adamraine commented 1 year ago

Yeah, looks like the audit is failing because entry.c1164377.js doesn't have a source map, and not because of sockjs.min.js. This file had a different name on my.

alexnj commented 1 year ago

I created a follow up issue #14996 to track the chrome plugin URL breaking the audit case.

alexnj commented 1 year ago

Re: the original issue — it seems like the inclusion of passing source-map entries with a partially failing valid-sourcemaps audit result is the cause for confusion. We could either drop the passed entries, or rearrange them under a sub-headings as Passed / scripts with valid source maps and Failed / scripts without source maps to resolve the ambiguity in the UI. Wdyt @adamraine ?

adamraine commented 1 year ago

Not sure about using Passed / Failed as headings since we need the sub-headings to display the failed messages. There are definitely a few ways to approach this though:

danurahadi commented 1 year ago

@adamraine @alexnj thank you all guys, for the response. btw, what's the meaning of P2 label?

adamraine commented 1 year ago

It's the issue priority on a 1-3 scale

danurahadi commented 1 year ago

ah i see. thank you.