question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ignoreErrors` and `beforeSend` options both cannot stop report error

See original GitHub issue

Package + Version

Version:

0.0.0

Description

My sentry received a lot of meaningless events: TypeError undefined is not an object (evaluating 'window.__pad.performLoop')

I want to stop this kind of events go into my sentry through ignoreErrors option:

Sentry.init({
  ignoreErrors: [
    /window.__pad.performLoop/i
  ],
})

but this ignoreErrors not working at all. So I have tried to use beforeSend option to achieve this:

const ignoreErrors = [
  'window.__pad.performLoop'
];
beforeSend(event) {
    if (event && event.message && ignoreErrors.find(item => event.message.includes(item))) {
      return null;
    }
    return event;
  }

Again, beforeSend option also not working, and my sentry still receive a lot of this events.

Here is my event json file.(I change it to txt format since github cannot upload json) event.txt

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
idahogurlcommented, Jun 15, 2021

@kamilogorek You were right about caching. Those errors have no release numbers because we had a regression that the release value wasn’t being passed. The new code has the release number and nothing for that release value is coming through. I decided to keep with using the Error Message filter in Settings. It’s a bit obfuscated since it’s not in the code but we don’t have to depend on the script. Thank you so much!!

1reaction
Zuckjetcommented, May 19, 2021

@kamilogorek Thanks for your effort. After seeing your test, I begin to think if it is my mistake that make this unexplainable result. So can i close this issue since my problem has been solved, and as for ignoreErrors, I cannot investigate anymore. If I have ignoreErrors problems in future, and will open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when returning null in beforeSend · Issue #3047 - GitHub
I tested returning null from both beforeSend callback and an event process, both dropped the event correctly and no issue similar to the...
Read more >
Filtering for React | Sentry Documentation
Filtering Error Events. Configure your SDK to filter error events by using the beforeSend callback method and configuring, enabling, or disabling integrations.
Read more >
React / Sentry for Error Reporting - How to not send errors ...
The easiest way I could get it working was to set the beforeSend method in Sentry.init to return null if the location is...
Read more >
@iobroker/js-controller-common-db | Yarn - Package Manager
The Library contains the common utils of ioBroker which use the DB directly and thus cannot be required by the DB itself (cirular...
Read more >
Customizing error reports - JavaScript - Bugsnag docs
If you want to halt the error notification completely, call report.ignore() or return false from beforeSend . You can set a beforeSend callback...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found