Skip to content
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

LCP is incorrect if image fails Timing-Allow-Origin check #138

Closed
mmocny opened this issue Apr 23, 2021 · 4 comments · Fixed by #327
Closed

LCP is incorrect if image fails Timing-Allow-Origin check #138

mmocny opened this issue Apr 23, 2021 · 4 comments · Fixed by #327

Comments

@mmocny
Copy link
Member

mmocny commented Apr 23, 2021

I was recently surprised to find a mismatch between LCP reported by DevTools timeline and Web Vitals extension. It looks like the cause is simply because the Web Platform api cannot always report the renderTime of image elements which do not pass Timing Allow Origin check for Cross Origin requests.

One easy way to check when this is the case is to check if the renderTime property of the Entry is 0.

If that happens, I think the recorded LCP value is likely not accurate. (In one case I was looking at, it was off by 1.2seconds).

I wonder if it is worth at least warning the developer in such cases?

@mmocny
Copy link
Member Author

mmocny commented Apr 23, 2021

@philipwalton
Copy link
Member

@mmocny what do you think about this as a solution? #155

@mmocny
Copy link
Member Author

mmocny commented May 31, 2021

When I filed this, my primary concern was as a developer testing, and a debug version of the library for such use cases is absolutely perfect for me.

The other aspect of this is developers reporting to RUM and then being surprised by mismatches with i.e. CrUX. I think that is addressed fine by documentation (and proactive education?) and needn't be a warning.

That said -- I don't think a debug version is super critical as we have increasingly many developer tools for CWV (such as the web-vitals overlap option in DevTools). I would use it if it were available!

@tunetheweb
Copy link
Member

Added a link to my article in #327 and going to close this with that. We can track the debug version in #155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants