toucan-js
toucan-js copied to clipboard
RewriteFrames from @sentry/integrations >= 7.74.0 is no longer compatible with toucan-js
Using from the RewriteFrames
the latest @sentry/integrations
no longer works. The integration's processEvent
is never called.
I believe this is because of a recent refactoring from Sentry where the integration's setupOnce
become a noop (source)
Toucan depends on setupOnce
calling the function that is passed to it, otherwise the event processor is never added to the SDK's scope (source).
If you use a version of @sentry/integrations
that matches the the one in use in toucan-js (ie. v7.76.0), you should not see this issue as the APIs will match.
Once this auto-generated PR is merged and a release cut, you'll be able to use newer versions.
Aligning sentry versions didn't work for me.
RewriteFrames from v.7.76.0 has the noop setupOnce
, which [email protected] expects to not be a noop. Unless I'm misunderstanding something?
Thanks!
Ah yes sorry you are correct, I didn't realise setupIntegrations
was overridden in the client. I guess this code need to be copied from Sentry core:
https://github.com/getsentry/sentry-javascript/blob/7303cdacb3ba2da1e71844e9daa5ffdb91d9a8a7/packages/core/src/integration.ts#L106-L130
Bumped into this as well – took me more than a day of trying to figure it out on Dec 8, a few days before this issue was filed; resumed that work today and found this, thank you for reporting!
FYI the title should be ">= 7.74.0" or "> 7.73.0" – 7.74.0 is the first version with noop setupOnce
.
With yarn
, the following override in package.json
makes it work:
"resolutions": {
"toucan-js/@sentry/core": "7.73",
"toucan-js/@sentry/integrations": "7.73",
"toucan-js/@sentry/types": "7.73",
"toucan-js/@sentry/utils": "7.73"
}
Issue title updated, good catch.
Sentry removed class-based integrations in v8. We just released a new version of Toucan that uses new function-based integrations in https://github.com/robertcepa/toucan-js/releases/tag/toucan-js%404.0.0
Upgrading to v4.0.0 should resolve this problem. Note that RewriteFrames
is now called rewriteFramesIntegration
.