Dev console errors are thrown to sentry
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
SDK Version
6.19.7
Framework Version
No response
Link to Sentry event
Steps to Reproduce
Only Chrome 102, older chrome versions don’t trigger it, other browsers uncheked
- Go to website with initialized sentry
- Open dev console
- Run
copy('any string')
Expected Result
“any string” is copied to clipboard, no errors triggered to sentry
Actual Result
“any string” is copied to clipboard, few errors triggered to sentry
Generally, all the errors that appear in console is triggered to sentry(
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:22 (12 by maintainers)
Top Results From Across the Web
Sentry picks up errors triggered from Chrome console #5288
This is due to a new ""feature"" in Chromium that causes window.onerror to fire for errors triggered from the debug console. Given that...
Read more >Capturing JavaScript Errors - Sentry
The Problem. You have a single page JavaScript application, and unlike your API server, the client-side application doesn't generate error logs.
Read more >How to report console.error with Sentry? - Stack Overflow
I have application where some critical issues are reported with console.error but are not thrown so ...
Read more >JavaScript | Sentry Documentation
On this page, we get you up and running with Sentry's SDK, so that it will automatically report errors and exceptions in your...
Read more >Top 5 @sentry/types Code Examples - Snyk
getsentry / sentry-javascript / packages / browser / src / integrations / instrumenthandlers.ts ... extra() { throw new Error('Something bad happened'); } ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The filter has been running for about 24h, and the issue count has dropped from 500+ to <20. The reported issues, for the most part, seem reasonable and related to my application. So for what its worth, it seems to work well.
Here is my modified version currently running, in case someone wants to use/modify it:
Hey @markivancho (and everyone else who’s getting these errors),
we’re still discussing how to best filter such browser-caused errors in the future automatically. In the meantime, you have a couple of options on how to filter these events out manually:
Using
beforeSend
You can add a filter criterion for
beforeSend
inSentry.init
. Something along these lines:Using
ignoreErrors
Alternatively, if you do not care about browser versions, you can go a simpler route and use the
ignoreErrors
property inSentry.init
. Note though, that this does not take the user agent into account at all and will thus ignore errors from all browsers:Using Inbound Filters in Sentry UI
We recognize that these approaches require a redeployment of your app with the changed SDK config. If this is not an option, you can do something similar to
ignoreErrors
above in the Sentry UI: In your project’s settings, go to “Inbound Filters” and at the bottom you can configure a filter for error messages.Again, this option filters out errors of all browsers, so similariy to
ignoreErrors
it cannot be applied to a specific browser (version).