Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Lighthouse "Best Practices" issue with zone.js #39484
Comments
|
@initplatform, |
|
Closing this ticket based on the comment above. Feel free to reopen if the problem still exists. Thank you. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
|
You can run lighthouse on our app to see it. This is build with :
|
|
Also.. we have upgraded to angular 11, same issue.
|
|
Also, shouldn't matter, but FWIW,
|
|
I ran Lighthouse on https://startbootstrap.com/ and the one report about |
|
This is weird.. If I do it multiple times I see one.. or the other... The first time I did it, I saw the facebook one like you.. but now I only seem to be getting the polyfills one I wonder if this may have something to do with the pwa voodoo in Are you able to run it multiple times and see the |
|
This is the contents of my polyfills.ts with all comments removed:
smoothscroll does not appear to be using I wonder if lighthouse is incorrectly thinking zone.js is using unload, since it includes -> var windowEventNames = [
'absolutedeviceorientation',
'afterinput',
'afterprint',
'appinstalled',
'beforeinstallprompt',
'beforeprint',
'beforeunload',
'devicelight',
'devicemotion',
'deviceorientation',
'deviceorientationabsolute',
'deviceproximity',
'hashchange',
'languagechange',
'message',
'mozbeforepaint',
'offline',
'online',
'paint',
'pageshow',
'pagehide',
'popstate',
'rejectionhandled',
'storage',
'unhandledrejection',
'unload',
'userproximity',
'vrdisplayconnected',
'vrdisplaydisconnected',
'vrdisplaypresentchange'
]; |
|
@initplatform, just like @gkalpak said, the
|
|
Here is what I believe happens: So, as @JiaLiPassion has said above, I am going to close this, since there doesn't seem to be anything to be fixed in Angular or |
|
Thanks @gkalpak and @JiaLiPassion. Makes sense. Looks like I need to file a bug against facebook :) |
InvestigationI'm seeing this in https://www.devintent.com/ which does not use I looked at each of the libraries in my Then after reading this thread, I thought that I might have been wrong... so I went and looked at https://www.devintent.com/polyfills-es2015.00bf12ee6ad9d54b5a1c.js and searched for the string in there and the only place that it was found was in the zone.js code. This error alone, takes 7 points off of the Lighthouse Best Practices audit. How to find the real culprit in your appI think that many people are going to hit this issue. It might be worth pinning it and providing clear steps for how to track down the actual library that registers the
In my case, the offending library is LogRocket. Should we write up an issue in the Lighthouse repo to ask them to make it smarter? It seems like the audit should be able to do this kind of thing automatically and save us a lot of extra issues. |




Affected Package
The issue is caused by zone.js
Is this a regression?
not applicable
Description
polyfills.tscontains:When running lighthouse on my app, I see this:
grepping though all the files that
polyfills.tspulls in, only zone.js uses unload.The details of the issue are here ->
https://developers.google.com/web/updates/2018/07/page-lifecycle-api?utm_source=lighthouse&utm_medium=devtools#the-unload-event
Running Lighthouse on any angular app should exhibit the issue.
Angular Version:
Anything else relevant?
Chrome -> Version 86.0.4240.111 (Official Build) (x86_64)