From 4cc0b8db2eaa32cd5fade66141c583d573c1a354 Mon Sep 17 00:00:00 2001 From: LeeJongBeom <52884648+devleejb@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:37:13 +0900 Subject: [PATCH] Fix issue where SourceMaps were not uploaded even though Sentry keys were correctly registered (#219) * Add debugging line in `gh_pages.yaml` * Change sentry enabling options * Restore GitHubActions `gh_pages.yaml` --- frontend/vite.config.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 110e1512..bd8a8202 100755 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -6,17 +6,19 @@ import { sentryVitePlugin } from "@sentry/vite-plugin"; // https://vitejs.dev/config/ export default defineConfig({ build: { - sourcemap: true, // Source map generation must be turned on + // Source map generation must be turned on + // Only enable Sentry plugin if the environment variables are set + sourcemap: Boolean( + process.env.SENTRY_ORG && process.env.SENTRY_PROJECT && process.env.SENTRY_AUTH_TOKEN + ), }, plugins: [ react(), version(), - // Only enable Sentry plugin if the environment variables are set - process.env.SENTRY_AUTH_TOKEN && - sentryVitePlugin({ - org: process.env.SENTRY_ORG, - project: process.env.SENTRY_PROJECT, - authToken: process.env.SENTRY_AUTH_TOKEN, - }), + sentryVitePlugin({ + org: process.env.SENTRY_ORG, + project: process.env.SENTRY_PROJECT, + authToken: process.env.SENTRY_AUTH_TOKEN, + }), ], });