From 28d5cd7e1d5fec1d2d8c4df9c91196173407e4d7 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Sat, 24 Oct 2026 14:48:42 -0400 Subject: [PATCH] fix: configure Sentry environment at build time --- .env.example | 3 +++ src/utils/errorReporting.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index ff34c3226..e8b8fb9c9 100644 --- a/.env.example +++ b/.env.example @@ -8,6 +8,9 @@ VITE_DICOM_WEB_NAME=ACME Hospital # Error reporting URL for sentry.io. VITE_SENTRY_DSN= +# Sentry environment label, such as production or development. Defaults to production. +VITE_SENTRY_ENVIRONMENT= + # VolView server remote URL VITE_REMOTE_SERVER_URL=http://localhost:4014 diff --git a/src/utils/errorReporting.ts b/src/utils/errorReporting.ts index 226b967e6..284efd757 100644 --- a/src/utils/errorReporting.ts +++ b/src/utils/errorReporting.ts @@ -4,7 +4,7 @@ import { useLocalStorage } from '@vueuse/core'; import { defineStore } from 'pinia'; import { App, ref, watch } from 'vue'; -const { VITE_SENTRY_DSN } = import.meta.env; +const { VITE_SENTRY_DSN, VITE_SENTRY_ENVIRONMENT } = import.meta.env; export const LOCAL_STORAGE_KEY = 'error-reporting-off'; @@ -16,6 +16,7 @@ export const init = (app: App) => { Sentry.init({ app, dsn: VITE_SENTRY_DSN, + environment: VITE_SENTRY_ENVIRONMENT || undefined, }); try {