-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lighthouse NO_LCP error due to offscreen animation #10869
Comments
Try running on a latest version of chrome |
Thanks for filing @CDDelta! I can reproduce and this appears to be a bug in the LCP metric itself, we'll look into it 👍 |
In my case here I was having this problem just in CircleCI build, local one was working fine. After updating the docker image from |
https://praesens.co also triggers the The error can be reproduced every time using any of the below (all return the
Here is the JSON report from 6.1: Here is the JSON report from 5.6, when all metrics worked, and the score was 100: I'm not sure if this info is helpful, but I was able to observe a Update Update 2
lcp value being undefined.
My guess would be that it's some sort of a timing issue/race condition, as the error rate decreases if the script is slightly delayed by running it in verbose mode. |
Thanks @widmanski I can reproduce this as well! |
I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1104218 with these details 👍 |
Looks like this has been fixed in chrome. Worth investigating to ensure LCP is reported on these sites. |
not for me @adamraine (v85.0.4183.121) |
Same here |
@patrickhulce in v85.0.4183.121 the bug is back. Do we have some regression here? Maybe if there is no change in painting? Do the LCP calc need at least one change to be detected? |
@danielhaim1 @RaicuRobert @hummal thanks for the clarification! There are many types of pages that receive NO_LCP and this issue only tracks a very specific one (when the LCP element animates from outside the viewport to in viewport). It's quite likely that this bug doesn't apply to you. A separate issue with a reproducible case or public URL would be much appreciated if you don't think your LCP element animates into the viewport :) |
Also @adamraine from our triage it looks like this is "WAI" from the LCP spec perspective which is really unfortunate for us. We're at a dead end. I'll file an issue on the LCP spec repo. |
@patrickhulce Thank you Patrick for answering that quick. I can provide a live page for my tests: https://flug.check24.de/fluege/spanien Edit: after some additional testing it does not occur when the cookie thingy is not there. But there is no opacity in this elements. Only background with alpha. |
Thanks for the extra info and the URL @hummal! There's something extra weird going on in Chromium for that URL I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1135165 I can also reproduce your intermittent behavior in Lighthouse. As part of the cookie loader, do you know if that removes any elements from the DOM when it loads? |
Update: This should be fixed for many sites with the latest stable Chrome (M97). From my testing, the following sites don't experiencing this error anymore:
The following sites are flaky: The following sites still produce the error: Since this is still reproducible on some sites, I'm going to leave this open and continue tracking the upstream issue. |
@adamraine Issue is fixed for my site! EDIT: spoke too soon, see comment below for update Small note - Lighthouse used to show fireworks for 100% perfect score including PWA. |
That's over in #12563 if you're interested |
Thanks! Also spoke too soon. The first lighthouse audit worked, but every subsequent audit as given me: Something went wrong with recording the trace over your page load. Please run Lighthouse again. (NO_LCP) |
Ah yup, exact same thing happening to me on DevTools and the CLI. |
I am also getting this on my website, akd.io. Version 99.0.4844.51 (Official Build) (arm64) |
I am getting this error when profiling and auditing my Next.js app. In my case this happens when body tag has Update: After playing with the values in CSS and the layout, I found out that the problem was with fullscreen Version 99.0.4844.84 (Official Build) (x86_64) |
Just ran into this issue on v105.0.5140.0 |
I have this issue now both on the latest chrome and on pagespeed insights: I didn't have this error last month. Maybe it's a regression? The error disappears if I disable the animations. However, the animation is not off screen. |
@mwt, you can solve this error by setting the animation's initial opacity to 0.01 |
Thanks. That worked. |
I have the same issue. I have tried these options: Maybe someone can suggest something? |
@tasesmuemils From what I can tell, the only content elements visible are SVGs. SVG elements do not qualify for LCP on their own: https://web.dev/lcp/#what-elements-are-considered |
It works, Thank you very much! |
For me the issue was that I have a 100vh x 100vw logo on the website and text only shows when you scroll down
Text to the dom (which sits in the top left corner) it works This is really dumb. |
@Coding-Kiwi THIS IS CRAZY!!!!! After losing hours of debugging and trying to figure out what the ***** was going on with LCP, finally, I decided to do what you recommended, and WOWOWOWOWWO!!!! That fixed it!!! THIS IS SOOOOO DUMB, INDEED!!! 🤯 THANK YOU 🙏 |
This problem occured today on airline-strategy.com where some animations are done using |
Same issue for me, can't believe this was the fix, surprised this hasn't affected more people and therefore been fixed by now. |
The problem is only with opacity: 0, which resolved if you set an opacity of 0.001. I would say placing an unused element in the top left corner is just shifting the problem and a proper missunderstanding of the reason why this happens. You should consider searching for your opacity settings in css and replace 0 with 0.001. Yes this is still not what we want and a wrong behavior how opacity is treated in lh but as long as this issue exists we have to live with it. Attention: An opacity of 0.01 is sometimes not enough. It can still be visible. To be sure to completely hide your element you have to use 0.001. Try out on the google.com main page and set opacity to 0.01 on the body element. You will see the google logo still shining through. I would suggest to use css variables to deal with the problem globally. Use the variable everywhere you want to set opacity 0. :root {
--opacity_0: 0.001;
}
.class-a {
opacity: var(--opacity_0);
} |
Since Lighthouse was updated to include the LCP metric my site doesn't get a performance score anymore. The error text asks me to rerun Lighthouse but I have done so multiple times and there's no effect.
Provide the steps to reproduce
What is the current behavior?
Performance score is not calculated as no LCP could be measured.
What is the expected behavior?
LCP can be properly calculated or Lighthouse fails gracefully with a performance score when it cannot be.
Environment Information
Tested on web.dev and CI server running latest Lighthouse.
The text was updated successfully, but these errors were encountered: