Skip to content

Commit

Permalink
fix: endpoint for is already called inside loadscript (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Aug 19, 2024
1 parent 0b40e5a commit f9506be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
16 changes: 5 additions & 11 deletions src/extensions/exception-autocapture/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
15 changes: 6 additions & 9 deletions src/extensions/web-vitals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f9506be

Please sign in to comment.