[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add ability to disable Sentry source maps #17699

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ NEXT_PUBLIC_SENDGRID_SENDER_NAME=
# Used for capturing exceptions and logging messages
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_DEBUG=
SENTRY_DISABLE_CLIENT_SOURCE_MAPS=
SENTRY_DISABLE_SERVER_SOURCE_MAPS=
SENTRY_MAX_SPANS=
SENTRY_TRACES_SAMPLE_RATE=

Expand Down Expand Up @@ -414,4 +416,4 @@ NEXT_PUBLIC_WEBSITE_TERMS_URL=
NEXT_PUBLIC_LOGGER_LEVEL=

# Used to use Replexica SDK, a tool for real-time AI-powered localization
REPLEXICA_API_KEY=
REPLEXICA_API_KEY=
10 changes: 9 additions & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const nextConfig = {
locales: ["en"],
localeDetection: false,
},
productionBrowserSourceMaps: false,
productionBrowserSourceMaps: process.env.SENTRY_DISABLE_CLIENT_SOURCE_MAPS === "0",
/* We already do type check on GH actions */
typescript: {
ignoreBuildErrors: !!process.env.CI,
Expand Down Expand Up @@ -223,6 +223,10 @@ const nextConfig = {
},
webpack: (config, { webpack, buildId, isServer }) => {
if (isServer) {
if (process.env.SENTRY_DISABLE_SERVER_SOURCE_MAPS === "1") {
config.devtool = false;
}

// Module not found fix @see https://github.com/boxyhq/jackson/issues/1535#issuecomment-1704381612
config.plugins.push(
new webpack.IgnorePlugin({
Expand Down Expand Up @@ -667,6 +671,10 @@ if (!!process.env.NEXT_PUBLIC_SENTRY_DSN) {
hideSourceMaps: true,
// disable source map generation for the server code
disableServerWebpackPlugin: !!process.env.SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN,
silent: false,
sourcemaps: {
disable: process.env.SENTRY_DISABLE_SERVER_SOURCE_MAPS === "1",
},
})
);
}
Expand Down
2 changes: 2 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@
"SENDGRID_API_KEY",
"SENDGRID_EMAIL",
"SENDGRID_SYNC_API_KEY",
"SENTRY_DISABLE_CLIENT_SOURCE_MAPS",
"SENTRY_DISABLE_SERVER_SOURCE_MAPS",
"SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN",
"SLACK_CLIENT_ID",
"SLACK_CLIENT_SECRET",
Expand Down
Loading