Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Fix sourcemaps association (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr committed Feb 17, 2024
2 parents d984c60 + 54d9304 commit cbf107f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/shared/next/next.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,23 @@ const nextConfig = {
},
};

const sentryWebpackPluginOptions = {};
const sentryWebpackPluginOptions = {
// The same release value needs to be used both:
// 1. here to create a new release on Sentry and upload sourcemaps to it,
// 2. and when initializing Sentry in the browser (`Sentry.init`).
release: gitSHA,
};

// withSentryConfig extends the default Next.js usage of webpack to:
//
// 1. Initialize the SDK on client page load (See `sentry.client.config.ts`)
//
// 2. Upload sourcemaps, using the settings defined in `sentry.properties`.
// Sourcemaps are only uploaded if SENTRY_AUTH_TOKEN is defined.
//
// Sourcemaps are only uploaded to Sentry if SENTRY_AUTH_TOKEN is defined. Note
// that sourcemaps are always generated in the static export; the Sentry Webpack
// plugin behavies as if the `productionBrowserSourceMaps` Next.js configuration
// setting is `true`.
//
// Irritatingly, Sentry insists that we create empty sentry.server.config.ts and
// sentry.edge.config.ts files, even though we are not using those parts.
Expand Down

0 comments on commit cbf107f

Please sign in to comment.