File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import * as Sentry from "@sentry/nextjs" ;
4+ import { useEffect } from "react" ;
5+
6+ export default function GlobalError ( {
7+ error,
8+ reset,
9+ } : {
10+ error : Error & { digest ?: string } ;
11+ reset : ( ) => void ;
12+ } ) {
13+ useEffect ( ( ) => {
14+ Sentry . captureException ( error ) ;
15+ } , [ error ] ) ;
16+
17+ return (
18+ < html >
19+ < body >
20+ < h2 > Something went wrong!</ h2 >
21+ < button onClick = { ( ) => reset ( ) } > Try again</ button >
22+ </ body >
23+ </ html >
24+ ) ;
25+ }
Original file line number Diff line number Diff line change 1+ import * as Sentry from "@sentry/nextjs" ;
2+
3+ Sentry . init ( {
4+ dsn : "https://e40fdc0a3e5965c1862e6594a8c2631f@o4507789962706944.ingest.us.sentry.io/4507789965721600" ,
5+ tracesSampleRate : 1.0 ,
6+ replaysSessionSampleRate : 0.1 ,
7+ replaysOnErrorSampleRate : 1.0 ,
8+ integrations : [
9+ Sentry . replayIntegration ( ) ,
10+ Sentry . feedbackIntegration ( {
11+ colorScheme : "system" ,
12+ } ) ,
13+ ] ,
14+ } ) ;
Original file line number Diff line number Diff line change 1+ import * as Sentry from "@sentry/nextjs" ;
2+
3+ export async function register ( ) {
4+ if ( process . env . NEXT_RUNTIME === "nodejs" ) {
5+ Sentry . init ( {
6+ dsn : "https://e40fdc0a3e5965c1862e6594a8c2631f@o4507789962706944.ingest.us.sentry.io/4507789965721600" ,
7+ tracesSampleRate : 1.0 ,
8+ } ) ;
9+ }
10+
11+ if ( process . env . NEXT_RUNTIME === "edge" ) {
12+ Sentry . init ( {
13+ dsn : "https://e40fdc0a3e5965c1862e6594a8c2631f@o4507789962706944.ingest.us.sentry.io/4507789965721600" ,
14+ tracesSampleRate : 1.0 ,
15+ } ) ;
16+ }
17+ }
18+
19+ export const onRequestError = Sentry . captureRequestError ;
Original file line number Diff line number Diff line change 11import type { NextConfig } from "next" ;
22import createNextIntlPlugin from 'next-intl/plugin' ;
3+ import { withSentryConfig } from "@sentry/nextjs" ;
34
45const withNextIntl = createNextIntlPlugin ( './i18n.ts' ) ;
56
@@ -33,4 +34,11 @@ const nextConfig: NextConfig = {
3334 } ,
3435} ;
3536
36- export default withNextIntl ( nextConfig ) ;
37+ export default withSentryConfig ( withNextIntl ( nextConfig ) , {
38+ org : "guillermoscript" ,
39+ project : "lms-front" ,
40+ silent : ! process . env . CI ,
41+ widenClientFileUpload : true ,
42+ disableLogger : true ,
43+ automaticVercelMonitors : true ,
44+ } ) ;
You can’t perform that action at this time.
0 commit comments