Open Zwyx opened 4 months ago
Assigning to @getsentry/support for routing ⏲️
I would add that the workaround provided in the linked discussion doesn't allow to use the Sentry crash-report modal, which is usually done with the showDialog
prop:
<Sentry.ErrorBoundary fallback={...} showDialog>
...
</Sentry.ErrorBoundary>
Core or SDK?
Platform/SDK
Which part? Which one?
JavaScript React
Description
When using React Router v6, setting up Sentry as recommended in the Getting started page is not enough to catch errors: any error happening in a route will be caught by React Router and not transmitted to Sentry.
Note: this only happens when the app is compiled. It does not happen in development mode, because React rethrows errors caught within an error boundary. So, if you test Sentry in development, you might think Sentry works correctly and catches all errors. But once in production, it won't work anymore!
Suggested Solution
The only way I made it work was using a solution provided by another user here.