getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.88k stars 1.55k forks source link

Cannot read properties of undefined (reading 'toLowerCase') on mousemove #10292

Closed RoyvanEmpel closed 8 months ago

RoyvanEmpel commented 8 months ago

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/vue

SDK Version

7.94.1

Framework Version

Vue 3.4.15

Link to Sentry event

https://sentry.aniday.io/share/issue/94391781baa34b2b9a3d40d3d21a70c8/

SDK Setup

  Sentry.init({
    app,
    dsn: import.meta.env.VITE_APP_SENTRY_URL,
    integrations: [
      new Sentry.BrowserTracing({
        routingInstrumentation: Sentry.vueRouterInstrumentation(router),
      }),
      new Sentry.Replay({
        maskAllText: false,
        maskAllInputs: false,
        blockAllMedia: false,
        block: ['img', 'video', 'object', 'picture', 'embed', 'map', 'audio'],
      }),
    ],
    tracesSampleRate: 1.0,
    replaysSessionSampleRate: 0.1,
    replaysOnErrorSampleRate: 1.0,
  });

Steps to Reproduce

I am having a problem with the session replays in sentry.

We recently setup sentry and sometimes when opening different pages in our system a lot of "toLowerCase" errors are displayed in the console. The errors are triggered by a mouse move event from sentry causing the clients PC to become very laggy and slow.

Atm our sentry is loaded into VueJS and for the time beeing vuejs is only a part of our total system. Since the rest of the system loads pages using Ajax and the vuejs index gets loaded anywere, sentry is loaded by default

It may also have something to do with the cloudflare rocket-loader as i saw that come by once in sentry's errors.

Expected Result

In this case the expected result would be that it doesn't spam the user with errors on the mouse event. And not slow down thier PC.

For now as a temporary fix in our production we have had to disabled the sentry replays.

Actual Result

These are a few screenshots of it happening in the console:

uTb8Otc NFBYbS5 1705865155591

Lms24 commented 8 months ago

Hi @RoyvanEmpel thanks for writing in! Looks like rrweb doesn't guard this properly (although according to the type definitions the name property should always be a string but 🤷).

I opened https://github.com/getsentry/rrweb/pull/160 which probably fixes the errors but I'll let the Replay team review this first (I might be missing some context here). cc @billyvg @mydea

RoyvanEmpel commented 8 months ago

Alright, will check if it's fixed when getsentry/rrweb#160 gets to a live version!

RoyvanEmpel commented 7 months ago

Hi @Lms24 when can we expect to see this in the sentry/vue package? We updates to the latest versions today for both sentry-selfhosted and sentry-vue and we are still recieving the 'toLowerCase' errors when enabeling the replays. Screenshot_20240202_115534

Lms24 commented 7 months ago

Hey @RoyvanEmpel we bumped to rrweb 2.10.0 a couple of days ago. With the next SDK release (7.100.0) you should receive the fix. Expect it to be released early next week. Sorry for the trouble!