diff --git a/src/server.ts b/src/server.ts index 1059b65..3e22791 100644 --- a/src/server.ts +++ b/src/server.ts @@ -348,7 +348,7 @@ export const cacheWrapper = async ( const sentryWrapper = async (event: FetchEvent, test = false): Promise => { let sentry: null | Toucan = null; - if (typeof SENTRY_DSN !== 'undefined' && !test) { + if (typeof SENTRY_DSN !== 'undefined' && SENTRY_DSN && !test) { /* We use Toucan for Sentry. Toucan is a Sentry SDK designed for Cloudflare Workers / DOs */ sentry = new Toucan({ dsn: SENTRY_DSN,