Skip to content

Commit

Permalink
fix: Updated Sentry config to remove monitoring error
Browse files Browse the repository at this point in the history
  • Loading branch information
kent committed Sep 10, 2024
1 parent dd54080 commit 0d13991
Showing 1 changed file with 17 additions and 38 deletions.
55 changes: 17 additions & 38 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/** @type {import('next').NextConfig} */

const path = require("path");
module.exports = {
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
},
};
const { withSentryConfig } = require("@sentry/nextjs");

/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
Expand Down Expand Up @@ -51,40 +48,22 @@ const nextConfig = {
},
};

module.exports = nextConfig;

// Injected content via Sentry wizard below
const sentryWebpackPluginOptions = {
silent: true,
org: "agora-ph",
project: "agora-next",
};

const { withSentryConfig } = require("@sentry/nextjs");
const sentryOptions = {
widenClientFileUpload: true,
transpileClientSDK: true,
hideSourceMaps: true,
disableLogger: true,
automaticVercelMonitors: true,
};

module.exports = withSentryConfig(
module.exports,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,
org: "agora-ph",
project: "agora-next",
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
nextConfig,
sentryWebpackPluginOptions,
sentryOptions
);

0 comments on commit 0d13991

Please sign in to comment.