From 89271314ac295d0c2e014e3f107c095aae9e2997 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Mon, 19 Aug 2024 09:10:01 +0100 Subject: [PATCH] fix: endpoint for is already called inside loadscript --- src/extensions/exception-autocapture/index.ts | 16 +++++----------- src/extensions/web-vitals/index.ts | 15 ++++++--------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/extensions/exception-autocapture/index.ts b/src/extensions/exception-autocapture/index.ts index 9ed6bb897..d6e1a7431 100644 --- a/src/extensions/exception-autocapture/index.ts +++ b/src/extensions/exception-autocapture/index.ts @@ -58,18 +58,12 @@ export class ExceptionObserver { cb() } - this.instance.requestRouter.loadScript( - this.instance.requestRouter.endpointFor( - 'assets', - `/static/exception-autocapture.js?v=${Config.LIB_VERSION}` - ), - (err) => { - if (err) { - return logger.error(LOGGER_PREFIX + ' failed to load script', err) - } - cb() + this.instance.requestRouter.loadScript(`/static/exception-autocapture.js?v=${Config.LIB_VERSION}`, (err) => { + if (err) { + return logger.error(LOGGER_PREFIX + ' failed to load script', err) } - ) + cb() + }) } private startCapturing = () => { diff --git a/src/extensions/web-vitals/index.ts b/src/extensions/web-vitals/index.ts index eb6a5e186..9eef95dcb 100644 --- a/src/extensions/web-vitals/index.ts +++ b/src/extensions/web-vitals/index.ts @@ -70,16 +70,13 @@ export class WebVitalsAutocapture { cb() } - this.instance.requestRouter.loadScript( - this.instance.requestRouter.endpointFor('assets', `/static/web-vitals.js?v=${Config.LIB_VERSION}`), - (err) => { - if (err) { - logger.error(LOGGER_PREFIX + ' failed to load script', err) - return - } - cb() + this.instance.requestRouter.loadScript(`/static/web-vitals.js?v=${Config.LIB_VERSION}`, (err) => { + if (err) { + logger.error(LOGGER_PREFIX + ' failed to load script', err) + return } - ) + cb() + }) } private _currentURL(): string | undefined {