From 57876706e9c6d37f7ceacae2945acabdd973e94d Mon Sep 17 00:00:00 2001 From: Faris Mahmutovic <115102863+faris-imi@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:16:01 +0100 Subject: [PATCH] fix(sentry): add polyfills and use xhr for es5 (#25) --- lib/src/polyfills.ts | 4 ++++ lib/src/sentry.ts | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/polyfills.ts b/lib/src/polyfills.ts index b46d37b..4de6837 100644 --- a/lib/src/polyfills.ts +++ b/lib/src/polyfills.ts @@ -1,4 +1,8 @@ import 'core-js/es/array/find'; +import 'core-js/es/array/includes'; 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(), diff --git a/package.json b/package.json index 89b6320..7419860 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@hcaptcha/loader", "description": "This is a JavaScript library to easily configure the loading of the hCaptcha JS client SDK with built-in error handling.", - "version": "1.2.2", + "version": "1.2.3", "author": "hCaptcha team and contributors", "license": "MIT", "keywords": [