diff --git a/.changeset/famous-plums-drum.md b/.changeset/famous-plums-drum.md new file mode 100644 index 00000000..2b2d3416 --- /dev/null +++ b/.changeset/famous-plums-drum.md @@ -0,0 +1,6 @@ +--- +"@exactly/server": patch +"@exactly/mobile": patch +--- + +🚑 fix sentry dsn import diff --git a/common/domain.js b/common/domain.js new file mode 100644 index 00000000..8e19ea55 --- /dev/null +++ b/common/domain.js @@ -0,0 +1,3 @@ +module.exports = /** @type {string} */ ( + process.env.EXPO_PUBLIC_DOMAIN || process.env.APP_DOMAIN || "sandbox.exactly.app" // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- ignore empty string +); diff --git a/common/domain.ts b/common/domain.ts deleted file mode 100644 index ddce03a3..00000000 --- a/common/domain.ts +++ /dev/null @@ -1 +0,0 @@ -export default process.env.EXPO_PUBLIC_DOMAIN ?? process.env.APP_DOMAIN ?? "sandbox.exactly.app"; diff --git a/common/sentryDSN.ts b/common/sentryDSN.js similarity index 50% rename from common/sentryDSN.ts rename to common/sentryDSN.js index 3a50c1ed..077562fc 100644 --- a/common/sentryDSN.ts +++ b/common/sentryDSN.js @@ -1,8 +1,9 @@ -import domain from "@exactly/common/domain"; +const domain = require("@exactly/common/domain"); const defaultDSN = "https://ac8875331e4cecd67dd0a7519a36dfeb@o1351734.ingest.us.sentry.io/4506186349674496"; -export default process.env.EXPO_PUBLIC_SENTRY_DSN || // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- ignore empty string +module.exports = + process.env.EXPO_PUBLIC_SENTRY_DSN || // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- ignore empty string { "web.exactly.app": defaultDSN, "sandbox.exactly.app": defaultDSN, diff --git a/server/instrument.cjs b/server/instrument.cjs index aadb9376..fda27dbb 100644 --- a/server/instrument.cjs +++ b/server/instrument.cjs @@ -3,7 +3,7 @@ const { nodeProfilingIntegration } = require("@sentry/profiling-node"); init({ release: require("@exactly/common/generated/release"), - dsn: process.env.EXPO_PUBLIC_SENTRY_DSN, + dsn: require("@exactly/common/sentryDSN"), environment: process.env.NODE_ENV === "production" ? "production" : "development", tracesSampleRate: process.env.NODE_ENV === "production" ? 1 : 0.01, profilesSampleRate: process.env.NODE_ENV === "production" ? 1 : 0.01, diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index a5a88d1a..c1ee0fda 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -1,4 +1,5 @@ import release from "@exactly/common/generated/release"; +import sentryDSN from "@exactly/common/sentryDSN"; import { init, mobileReplayIntegration, reactNavigationIntegration, wrap } from "@sentry/react-native"; import { ToastProvider } from "@tamagui/toast"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; @@ -29,7 +30,7 @@ export { ErrorBoundary } from "expo-router"; const routingInstrumentation = reactNavigationIntegration(); init({ release, - dsn: process.env.EXPO_PUBLIC_SENTRY_DSN, + dsn: sentryDSN, environment: __DEV__ ? "development" : "production", tracesSampleRate: 1, attachStacktrace: true,