Skip to content
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

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

Open
piyushsinghania opened this issue Nov 22, 2023 · 5 comments · May be fixed by #1145
Open

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

piyushsinghania opened this issue Nov 22, 2023 · 5 comments · May be fixed by #1145

Comments

@piyushsinghania
Copy link

piyushsinghania commented Nov 22, 2023

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
Copy link
Author

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

image

@MarcusEngvall
Copy link

MarcusEngvall commented Dec 1, 2023

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);
    };

@amokrunnr
Copy link

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?

@piyushsinghania
Copy link
Author

piyushsinghania commented Dec 7, 2023

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

I have the same question as that of @amokrunnr

@waltjones
Copy link
Contributor

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.

@b3bb0 b3bb0 linked a pull request Oct 3, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants