Uncaught TypeError: Cannot read properties of undefined (reading 'startTime') in `getCLS` logic
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
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
and lastSessionEntry
are undefined but being used without any check
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read properties of undefined ...
during destructuring, as: newValue < oldRows[row.interval + 1]?.start_time). and const startTime = parseInt(row?.start_time);.
Read more >Cannot read properties of undefined (reading 'startTime')
So I installed sentry.io on my application - I started getting this error "Cannot read properties of undefined (reading 'startTime')" ...
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >uncaught typeerror: cannot read properties of ... - You.com
The solution to TypeError: Cannot read properties of undefined Always conditionally check for the variable that is undefined before accessing the value.
Read more >Avoiding those dang cannot read property of undefined errors
Uncaught TypeError : Cannot read property 'foo' of undefined. The dreaded error we all hit at some point in JavaScript development.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm that I’m also seeing this. I’m seeing this with NextJS and
@sentry/nextjs
also when running in dev mode.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?