Skip to content

Commit

Permalink
fix: try simplifying sentry dsn lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
mplewis committed Nov 20, 2024
1 parent d9927f9 commit eba3c06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/src/lib/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import * as Sentry from '@sentry/react'
let dsn = ''
let environment = 'development'

console.log({ env: process.env })
// HACK: I think this helps the build rewrite find the env var
const SENTRY_DSN = process.env.SENTRY_DSN

if (typeof process === 'undefined' || !process.env?.SENTRY_DSN) {
if (typeof process === 'undefined' || !SENTRY_DSN) {
console.error(
'Missing SENTRY_DSN environment variable. Did you forget to add it to ' +
'your redwood.toml file in `includeEnvironmentVariables`?'
Expand All @@ -19,7 +20,7 @@ if (typeof process === 'undefined' || !process.env?.SENTRY_DSN) {
`)
console.error('Sentry is disabled for now')
} else {
dsn = process.env.SENTRY_DSN
dsn = SENTRY_DSN
environment = process.env.NODE_ENV
}

Expand Down

0 comments on commit eba3c06

Please sign in to comment.