-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Uncaught TypeError: Cannot read properties of undefined (reading 'startTime') in getCLS
logic
#6083
Comments
Hey @Tofandel, thanks for reporting! This is related to us upgrading to web vitals v3 #5987, and seems to be a problem with web vitals as well: @philipwalton do we have to adjust the logic in web vitals repo - or is this a case that shouldn't be possible? |
getCLS
logic
I don't believe this case should be possible, so I'm not sure how it's happening here. Referencing the I'd need more context for the error report in order to know whether or not it reflects a real case or perhaps just a fluke error. |
I'm seeing the same error with @sentry/nextjs. (Hosting a react app on vercel) |
@philipwalton it's definitely not a fluke, I get the error every single layout shift 100% of the time |
Looking through the changes for the Web Vitals v3 update I performed, the Before: sentry-javascript/packages/tracing/src/browser/web-vitals/getCLS.ts Lines 54 to 59 in 5386ce7
After: sentry-javascript/packages/tracing/src/browser/web-vitals/getCLS.ts Lines 62 to 66 in 25b5f6f
This check was added in this PR but as far as I can tell, the Let me do some debugging and I'll get back to you... |
I'm unable to reproduce the error with the most basic example: <!DOCTYPE html>
<html lang="en">
<head>
<title>CLS Test</title>
<style>
.test:hover {
padding-top: 200px;
}
</style>
</head>
<body>
<h1 class="test">Hello, world!</h1>
<script src="https://browser.sentry-cdn.com/7.17.2/bundle.tracing.debug.min.js"></script>
<script>
Sentry.init({
dsn: "__DSN__",
debug: true,
release: "tracing-demo@1.2.3-test",
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 1.0,
});
</script>
</body>
</html> Any info that may help me reproduce the issue locally would be greatly appreciated! |
I can confirm that I'm also seeing this. |
@Tofandel do you have an repro you could share? Even if not a reduced case, I'd like to try debugging to see how this is happening. |
Also seeing this reported in production ( |
Humm well now that I reverted to previous version and reupgraded to make a reproduction, I'm trying the same thing as before and it's not happening at all... When before it was always happening 🤔 Looking at the source, it does make sense it wouldn't happen because The only thing that makes sense is this is a race condition between the extremely short amount of time |
@timfish for the time being let’s just add a Boolean check to the conditional to unblock users? We can then cut a patch release with that. We can always revert it later when we investigate more and reproduce it. |
This has been released with https://github.com/getsentry/sentry-javascript/releases/tag/7.17.3, closing as such, but maybe we should open an issue in the web vitals repo and continue investigating there? |
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
@sentry/vue
SDK Version
7.17.2
Framework Version
7.17.2
Link to Sentry event
https://sentry.tukan.hu/share/issue/cc80369f87ff438e88e5d6caf67987c9/
Steps to Reproduce
Move the mouse around on an element creating a layout shift (eg a row that expands on hover)
Expected Result
No error
Actual Result
Js error on line
https://github.com/getsentry/sentry-javascript/blob/master/packages/tracing/src/browser/web-vitals/getCLS.ts#L64
Uncaught TypeError: Cannot read properties of undefined (reading 'startTime')
firstSessionEntry
andlastSessionEntry
are undefined but being used without any checkThe text was updated successfully, but these errors were encountered: