-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Cannot read properties of undefined (reading 'startTime') #41066
Comments
I am actually noticing the same issue |
Hello there, @qLutCh55 . What is the version of your SDK? Is it related to this issue: getsentry/sentry-javascript#6083? |
Routing to @getsentry/support for triage. ⏲️ |
@masinette Yeah seems to be the same issue. With the team already pushing a fix. Thanks |
Same issue here |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Environment
SaaS (https://sentry.io/)
Version
NA
Steps to Reproduce
So I installed sentry.io on my application - I started getting this error "Cannot read properties of undefined (reading 'startTime')" however nowhere in my codebase do I use the word "startTime".
Examined my app.js to see that it is something coming from sentry.io code.
App.js
let n,r=0,a=[];const o=t=>{t.forEach((t=>{if(!t.hadRecentInput){const e=a[0],o=a[a.length-1];r&&t.startTime-o.startTime<1e3&&t.startTime-e.startTime<5e3?(r+=t.value,a.push(t)):(r=t.value,a=[t]),r>i.value&&(i.value=r,i.entries=a,n&&n())}}))},s=be("layout-shift",o);s&&(n=he(t,i,e.reportAllChanges),xe((()=>{o(s.takeRecords()),n(!0)})))})((t=>{const e=t.entries.pop();e&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.kg.log("[Measurements] Adding CLS")
The related node_module file - node_modules/@sentry/tracing/esm/browser/web-vitals/getCLS.js - somewhere between line 50 and 71.
`// const handleEntries = (entries: Metric['entries']) => {
const handleEntries = (entries) => {
entries.forEach(entry => {
// Only count layout shifts without recent user input.
if (!entry.hadRecentInput) {
const firstSessionEntry = sessionEntries[0];
const lastSessionEntry = sessionEntries[sessionEntries.length - 1];
Seems to call the property startTime of lastSessionEntry - which might not be available. Unfortunely I cannot provide the issue share link from sentry.io, as it contains sensitive information as user ip, etc.
Expected Result
No console or tracking error from importing sentry into application.
Actual Result
Get error - Cannot read properties of undefined (reading 'startTime')
The text was updated successfully, but these errors were encountered: