diff --git a/apps/condo/domains/common/utils/sentry.ts b/apps/condo/domains/common/utils/sentry.ts index eb681d70ffd..8dac3bc36ed 100644 --- a/apps/condo/domains/common/utils/sentry.ts +++ b/apps/condo/domains/common/utils/sentry.ts @@ -5,7 +5,7 @@ import getConfig from 'next/config' // refs. to: https://github.com/vercel/next.js/blob/canary/examples/with-sentry/utils/sentry.js export const initSentry = () => { const { publicRuntimeConfig } = getConfig() - const { sentryDsn, isProduction } = publicRuntimeConfig + const { sentryDsn } = publicRuntimeConfig if (sentryDsn) { const integrations = [] @@ -30,7 +30,7 @@ export const initSentry = () => { Sentry.init({ integrations, dsn: sentryDsn, - enabled: isProduction, + enabled: true, }) } } diff --git a/apps/condo/index.js b/apps/condo/index.js index acff0909b42..f2be1c2d04e 100644 --- a/apps/condo/index.js +++ b/apps/condo/index.js @@ -14,9 +14,11 @@ const { EmptyApp } = require('@core/keystone/test.utils') const { prepareDefaultKeystoneConfig } = require('@core/keystone/setup.utils') const { registerSchemas } = require('@core/keystone/schema') -require('dd-trace').init({ - logInjection: true, -}) +if (conf.NODE_ENV === 'production') { + require('dd-trace').init({ + logInjection: true, + }) +} const keystone = new Keystone({ ...prepareDefaultKeystoneConfig(conf), diff --git a/apps/condo/next.config.js b/apps/condo/next.config.js index ba0bf3e7a5d..a9f2ea02aad 100644 --- a/apps/condo/next.config.js +++ b/apps/condo/next.config.js @@ -15,7 +15,6 @@ const apolloGraphQLUrl = `${serverUrl}/admin/api` const firebaseConfig = conf['FIREBASE_CONFIG'] && JSON.parse(conf['FIREBASE_CONFIG']) const addressSuggestionsConfig = conf['ADDRESS_SUGGESTIONS_CONFIG'] && JSON.parse(conf['ADDRESS_SUGGESTIONS_CONFIG']) const sentryDsn = conf['SENTRY_DSN'] -const isProduction = conf['NODE_ENV'] === 'production' const mapApiKey = conf['MAP_API_KEY'] module.exports = withSourceMaps(withTM(withLess(withCSS({ @@ -23,7 +22,6 @@ module.exports = withSourceMaps(withTM(withLess(withCSS({ // Will be available on both server and client sentryDsn, serverUrl, - isProduction, firebaseConfig, apolloGraphQLUrl, addressSuggestionsConfig, @@ -38,7 +36,7 @@ module.exports = withSourceMaps(withTM(withLess(withCSS({ config.resolve.alias['@sentry/node'] = '@sentry/browser' } - if (sentryDsn && isProduction) { + if (sentryDsn && conf['ENABLE_SENTRY_SOURCEMAPS_UPLOADING'] === 'true') { config.plugins.push( new SentryWebpackPlugin({ include: '.next',