From f3c1d2297a13a089d6021ae420b4bb1a8db79df3 Mon Sep 17 00:00:00 2001 From: Faris Mahmutovic Date: Thu, 22 Feb 2024 01:55:52 +0100 Subject: [PATCH] fix(sentry): add polyfills and use xhr for es5 --- lib/src/polyfills.ts | 3 +++ lib/src/sentry.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/polyfills.ts b/lib/src/polyfills.ts index b46d37b..3a0a995 100644 --- a/lib/src/polyfills.ts +++ b/lib/src/polyfills.ts @@ -2,3 +2,6 @@ import 'core-js/es/array/find'; import 'core-js/es/object/assign'; import 'core-js/es/object/entries'; import 'core-js/es/object/get-own-property-descriptors'; +import 'core-js/es/map'; +import 'core-js/es/set'; +import 'core-js/es/symbol'; diff --git a/lib/src/sentry.ts b/lib/src/sentry.ts index 42c353c..255b4bd 100644 --- a/lib/src/sentry.ts +++ b/lib/src/sentry.ts @@ -24,7 +24,7 @@ export function initSentry( const client = new Sentry.BrowserClient({ dsn: SENTRY_DSN, - transport: Sentry.makeFetchTransport, + transport: window.fetch ? Sentry.makeFetchTransport : Sentry.makeXHRTransport, stackParser: Sentry.defaultStackParser, integrations: [ new Sentry.Breadcrumbs(),