Skip to content

Commit 0ce155b

Browse files
committed
chore: update Sentry to latest version
1 parent c3d47a4 commit 0ce155b

File tree

7 files changed

+8237
-3448
lines changed

7 files changed

+8237
-3448
lines changed

instrumentation.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Sentry from "@sentry/nextjs";
2+
3+
export async function register() {
4+
if (process.env.NEXT_RUNTIME === "nodejs") {
5+
await import("./sentry.server.config");
6+
}
7+
8+
if (process.env.NEXT_RUNTIME === "edge") {
9+
await import("./sentry.edge.config");
10+
}
11+
}
12+
13+
export const onRequestError = Sentry.captureRequestError;
14+

next.config.mjs

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,20 @@ import { createRequire } from 'module';
33

44
const require = createRequire(import.meta.url);
55

6-
// eslint-disable-next-line @typescript-eslint/no-var-requires
7-
const { withSentryConfig } = require('@sentry/nextjs');
6+
const { withSentryConfig } = require("@sentry/nextjs");
87

98
/** @type {import("next").NextConfig} */
109
const config = {
1110
reactStrictMode: true,
12-
13-
/**
14-
* If you have `experimental: { appDir: true }` set, then you must comment the below `i18n` config
15-
* out.
16-
*
17-
* @see https://github.com/vercel/next.js/issues/41980
18-
*/
19-
i18n: {
20-
locales: ['en'],
21-
defaultLocale: 'en',
22-
},
2311
};
2412

2513
// Make sure adding Sentry options is the last code to run before exporting
2614
export default withSentryConfig(
2715
config,
2816
{
29-
// For all available options, see:
30-
// https://github.com/getsentry/sentry-webpack-plugin#options
31-
32-
// Suppresses source map uploading logs during build
3317
silent: true,
34-
3518
org: 'bigcommerce',
3619
project: 'ai-app-foundation',
20+
authToken: process.env.SENTRY_AUTH_TOKEN,
3721
},
38-
{
39-
// For all available options, see:
40-
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
41-
42-
// Upload a larger set of source maps for prettier stack traces (increases build time)
43-
widenClientFileUpload: true,
44-
45-
// Transpiles SDK to be compatible with IE11 (increases bundle size)
46-
transpileClientSDK: true,
47-
48-
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
49-
tunnelRoute: '/monitoring',
50-
51-
// Hides source maps from generated client bundles
52-
hideSourceMaps: true,
53-
54-
// Automatically tree-shake Sentry logger statements to reduce bundle size
55-
disableLogger: true,
56-
}
5722
);

0 commit comments

Comments
 (0)