-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: reactIssues related to the Sentry React SDKIssues related to the Sentry React SDK
Description
Is 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 SDK are you using?
@sentry/react
SDK Version
7.111.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: config.sentryDsn,
enabled: config.sentryEnabled,
environment: config.sentryEnvironment,
release: config.sentryRelease,
beforeSend: (event) => {
if (config.sentryEnabled) return event;
// If sentry is disabled, log events to the console
if (event.exception?.values) {
for (const e of event.exception.values) {
console.error(e);
}
} else {
console.debug("Sentry event", event);
}
return event;
},
beforeSendTransaction: (txEvent) => {
// If an e2e user, do not log any transactions. We've seen our e2e tests
// spam Sentry, bleeding quota.
if (
isInternalEmail(txEvent.user?.email) &&
txEvent.user?.email?.startsWith("infra+cloud-integration-tests")
) {
return null;
}
return txEvent;
},
integrations: [
new Sentry.BrowserTracing({
routingInstrumentation: Sentry.reactRouterV6Instrumentation(
React.useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
),
}),
],
normalizeDepth: 8,
tracesSampler: (samplingContext) => {
if (samplingContext.polled) {
return 0.01;
} else {
return 0.3;
}
},
});Steps to Reproduce
- Wrap a component in
Sentry.ErrorBoundary - Reject a promise from that component, or `throw "some string"
Expected Result
The type of the error object should be unknown, since you can throw any object in javascript.
Actual Result
The error object is typed as Error, which can lead to runtime errors.
Metadata
Metadata
Assignees
Labels
Package: reactIssues related to the Sentry React SDKIssues related to the Sentry React SDK
Projects
Status
No status