From 96c9407414f31a51381fa00f37386e363f510fc8 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 18 Jun 2023 14:49:25 +0200 Subject: [PATCH] feat(sentry): only load sentry when it's enabled --- src/main.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index bbce28ab4..347d5d392 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,6 @@ import {createApp} from 'vue' import pinia from './pinia' import router from './router' import App from './App.vue' -import {setupSentry} from './sentry' import {error, success} from './message' import {VERSION} from './version.json' @@ -105,12 +104,13 @@ setLanguage(browserLanguage).then(() => { } if (window.SENTRY_ENABLED) { - try{ - setupSentry(app, router) - } catch(e) { - console.error('Could not enable Sentry tracking', e) + try { + import {setupSentry} from './sentry' + setupSentry(app, router).then(sentry => sentry.default(app, router)) + } catch (e) { + console.error('Could not enable Sentry tracking', e) + } } -} app.use(pinia) app.use(router)