rollbar.js icon indicating copy to clipboard operation
rollbar.js copied to clipboard

Rollbar in Vue app causes freeze / 100% CPU usage (inf. recursion)

Open piyushsinghania opened this issue 2 years ago • 5 comments

I have a color picker in my site which shows up on clicking an icon. The site is built using Vue and is integrated with Rollbar. Though rollbar is working fine and is able to log errors to the dashboard. But few days back I encountered a weird problem with rollbar, when I mistakenly missed to add the input tag for color picker.

image

What is expected? Ideally there should be an error and it should be logged in rollbar.

What is happening? There's and infinite log of warning from rollbar in the console and the CPU utilisation peaks up to 100% and the site freezes.

image image image

Removing Rollbar - Removing rollbar integration doesn't freezes the site and logs the following warning and error in console -

image

image

Is there anything wrong with Rollbar internals? or is there a way I can tackle this problem? Thanks, Ahead!

piyushsinghania avatar Nov 22 '23 15:11 piyushsinghania

Removing the vueComponent optional parameter from rollbar.error method helped me to prevent app freeze.

image

piyushsinghania avatar Nov 28 '23 08:11 piyushsinghania

We had this exact issue in our app. piyushsinghania's fix solved all issues for us when the underlying problem was an error being reported by Vue, however if there were warnings (such as computed property X is readOnly but was assigned to...) then the infinity-loop would still trigger. Adding a warningHandler solved this for us.

    app.config.errorHandler = (error, vm, info) => {
      rollbar.error(error, { info });
      console.error(error);
    };
    app.config.warnHandler = (msg, instance ,trace) => {
      console.warn(msg);
    };

MarcusEngvall avatar Dec 01 '23 12:12 MarcusEngvall

I was also experiencing a similar freeze, rollbar.umn.min.js was hanging at this line: try{for(o in e)(n=e[o])&&(i(n,"object")||i(n,"array"))?r.includes(n)?u[o]="Removed circular reference: "+s(n):((a=r.slice()).push(n)

@piyushsinghania 's fix has addressed it.

What rollbar functionality am I losing by removing the vueComponent parameter?

amokrunnr avatar Dec 07 '23 14:12 amokrunnr

What rollbar functionality am I losing by removing the vueComponent parameter?

I have the same question as that of @amokrunnr

piyushsinghania avatar Dec 07 '23 14:12 piyushsinghania

What rollbar functionality am I losing by removing the vueComponent parameter?

It can be safely omitted.

This is the object representing the component where the error happened. Not selective error info, but rather the full object.

This shows up as a custom key in the Rollbar error, when passed as shown in the example.

If you're seeing an issue like described above, or an issue related to the size of the object, it can be omitted, or you can pass only the part(s) you're interested in.

waltjones avatar Jan 02 '24 22:01 waltjones