File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
export async function register ( ) {
2
- if ( process . env . NEXT_RUNTIME === 'nodejs' ) {
2
+ if ( process . env . NEXT_RUNTIME === 'nodejs' && process . env . NEXT_PUBLIC_SENTRY_DSN ) {
3
3
await import ( './sentry.server.config.js' )
4
4
}
5
5
}
Original file line number Diff line number Diff line change @@ -42,12 +42,21 @@ const config = withBundleAnalyzer(
42
42
'.mjs' : [ '.mts' , '.mjs' ] ,
43
43
}
44
44
45
+ // Ignore sentry warnings when not wrapped with withSentryConfig
46
+ webpackConfig . ignoreWarnings = [
47
+ ...( webpackConfig . ignoreWarnings ?? [ ] ) ,
48
+ { file : / e s m \/ p l a t f o r m \/ n o d e \/ i n s t r u m e n t a t i o n .j s / } ,
49
+ { module : / e s m \/ p l a t f o r m \/ n o d e \/ i n s t r u m e n t a t i o n .j s / } ,
50
+ ]
51
+
45
52
return webpackConfig
46
53
} ,
47
54
} ) ,
48
55
)
49
56
50
- export default withSentryConfig ( config , {
51
- telemetry : false ,
52
- tunnelRoute : '/monitoring-tunnel' ,
53
- } )
57
+ export default process . env . NEXT_PUBLIC_SENTRY_DSN
58
+ ? withSentryConfig ( config , {
59
+ telemetry : false ,
60
+ tunnelRoute : '/monitoring-tunnel' ,
61
+ } )
62
+ : config
You can’t perform that action at this time.
0 commit comments