Environment
- @sentry/react 7.91.0
- React 18 (CRA)
- No DSN provided intentionally (for local development)
Problem
When DSN
is undefined, and beforeSend
attempts to mutate the event object (e.g. strip sensitive fields), the mutation is ignored entirely and the function seems to be skipped.
Steps to Reproduce
- Initialize Sentry without a DSN.
- Add
beforeSend
that mutates event.extra
or event.request
.
- Log error via
Sentry.captureMessage("test")
.
Expected Result
beforeSend
still runs and mutates event before it's discarded.
Actual Result
beforeSend
is silently skipped; event object remains unprocessed.
Suggestion
Perhaps invoke beforeSend
even when DSN is undefined — for dev-mode debugging/logging flows.