You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import*asSentryfrom"@sentry/react";importposthogfrom"posthog-js";importReactfrom"react";import{createRoutesFromChildren,matchRoutes,useLocation,useNavigationType,}from"react-router";// Using the posthog.sentryIntegrationPlugin makes the stack trace unreadableSentry.init({dsn: ENV.SENTRY_DSN,integrations: [Sentry.browserProfilingIntegration(),Sentry.reactRouterV7BrowserTracingIntegration({useEffect: React.useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,}),posthog.sentryIntegration({organization: "project",projectId: 123,}),],});
Stack trace in sentry looks like this. We can only see the minified version:
Hi I found a bug in SentryPlugin that makes the stack traces in sentry unreadable when using source maps.
I am using:
Stack trace in sentry looks like this. We can only see the minified version:
Work around
I have found a workaround. After inspecting the source code for the sentryPlugin https://github.com/PostHog/posthog-js/blob/main/src/extensions/sentry-integration.ts we can just write it ourself as a custom plugin:
This only creates a one way binding from Sentry to Posthog and not the other way. But for me this is fine.
Root cause
I think the root cause is that the sentryPlugin is mutating the exceptions of the event from Sentry:
Instead of mutating this i think it should be mapped over and copied to a new variable.
The text was updated successfully, but these errors were encountered: