beforeSend threw an error, will not send event
See original GitHub issueSentry SDK and version: “@sentry/browser”: “5.15.5”,
in index.js, which runs reactDOM.render:
import { init } from '@sentry/browser';
init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
release: process.env.SHORT_SHA,
debug: true,
});
Debug output:
It seems like init happens twice, or at least that the error logs are duplicated. I have ensured that all three env vars are defined and that I only call init once.
It’s a bit curious since I haven’t implemented my own beforeSend. If I implement beforeSend and log (event, hint), it’s not logged at all.
What is the cause of this error? Any ideas on how I can troubleshoot this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Sentry BeforeSend not being triggered in Sentry.AspNetCore ...
Currently, BeforeSend only fires for error events, not for transactions, sessions, or other envelope types. However, in version 3.21.0 and ...
Read more >How to use the @sentry/utils.logger.log function in ... - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... as Error, }); reject('`beforeSend` threw...
Read more >Filtering for React | Sentry Documentation
beforeSend is called immediately before the event is sent to the server, so it's the final place where you can edit its data....
Read more >JavaScript - Docs - Sentry Documentation
In most situations, you can capture errors automatically with ... Sentry.init({ beforeSend(event) { // Modify the event here if(event.user){ // Don't send ......
Read more >jQuery.ajax() | jQuery API Documentation
A string containing the URL to which the request is sent. ... This is an Ajax Event. ... any malformed JSON is rejected...
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 FreeTop 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
Top GitHub Comments
Finally found the issue: our segment.io snippet made inited Sentry a second time. Thank you for helping with troubleshooting!!! @kamilogorek
I upgraded from
@sentry/react-native
1.2.0 to 3.4.3 and the issue went away.