sentry-javascript: `ignoreErrors` and `beforeSend` options both cannot stop report error
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
- “@sentry/angular”: “^6.2.3”,
- “@sentry/integrations”: “^6.2.3”,
- “@sentry/cli”: “^1.63.1”,
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (8 by maintainers)
@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 Messagefilter inSettings. 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!!@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 haveignoreErrorsproblems in future, and will open a new issue.