From 1339550c808218ad92ae99cbd5f82d6b2a72c137 Mon Sep 17 00:00:00 2001 From: sam Date: Sat, 30 Dec 2023 15:38:23 +0100 Subject: [PATCH] fix: don't require a valid sentry dsn for the frontend --- .woodpecker/.frontend.yml | 2 +- frontend/src/hooks.server.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.woodpecker/.frontend.yml b/.woodpecker/.frontend.yml index a10ef11..228ce76 100644 --- a/.woodpecker/.frontend.yml +++ b/.woodpecker/.frontend.yml @@ -3,7 +3,7 @@ steps: image: node directory: frontend environment: # SvelteKit expects these in the environment during build time. - - PRIVATE_SENTRY_DSN=non_existent_dsn + - PRIVATE_SENTRY_DSN= - PUBLIC_BASE_URL=http://pronouns.localhost - PUBLIC_MEDIA_URL=http://pronouns.localhost/media - PUBLIC_SHORT_BASE=http://prns.localhost diff --git a/frontend/src/hooks.server.ts b/frontend/src/hooks.server.ts index e073554..670f914 100644 --- a/frontend/src/hooks.server.ts +++ b/frontend/src/hooks.server.ts @@ -2,7 +2,9 @@ import { PRIVATE_SENTRY_DSN } from "$env/static/private"; import * as Sentry from "@sentry/node"; import type { HandleServerError } from "@sveltejs/kit"; -Sentry.init({ dsn: PRIVATE_SENTRY_DSN }); +if (PRIVATE_SENTRY_DSN) { + Sentry.init({ dsn: PRIVATE_SENTRY_DSN }); +} export const handleError = (({ error, event }) => { console.log(error);