File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { NextConfig } from 'next' ;
22import withBundleAnalyzer from '@next/bundle-analyzer' ;
3+ import { withSentryConfig } from '@sentry/nextjs' ;
34
45const withAnalyzer = withBundleAnalyzer ( {
56 enabled : process . env . ANALYZE === 'true' ,
67} ) ;
78
89const nextConfig : NextConfig = {
10+ trailingSlash : true ,
911 async headers ( ) {
1012 return [
1113 {
@@ -65,4 +67,15 @@ const nextConfig: NextConfig = {
6567 } ,
6668} ;
6769
68- export default withAnalyzer ( nextConfig ) ;
70+ export default withSentryConfig (
71+ withAnalyzer ( nextConfig ) ,
72+ {
73+ org : process . env . SENTRY_ORG ,
74+ project : process . env . SENTRY_PROJECT ,
75+ authToken : process . env . SENTRY_AUTH_TOKEN ,
76+ widenClientFileUpload : true ,
77+ tunnelRoute : '/monitoring' ,
78+ silent : ! process . env . CI ,
79+ // Tree-shaking disabled — using Turbopack which doesn't support webpack tree-shaking
80+ }
81+ ) ;
Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import * as Sentry from "@sentry/nextjs" ;
4+ import NextError from "next/error" ;
5+ import { useEffect } from "react" ;
6+
7+ export default function GlobalError ( {
8+ error,
9+ } : {
10+ error : Error & { digest ?: string } ;
11+ } ) {
12+ useEffect ( ( ) => {
13+ Sentry . captureException ( error ) ;
14+ } , [ error ] ) ;
15+
16+ return (
17+ < html >
18+ < body >
19+ < NextError statusCode = { 0 } />
20+ </ body >
21+ </ html >
22+ ) ;
23+ }
You can’t perform that action at this time.
0 commit comments