File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,18 +12,19 @@ Sentry.init({
1212 // Setting this option to true will print useful information to the console while you're setting up Sentry.
1313 debug : false ,
1414 ignoreErrors : [
15+ "Can't find variable: _sz" ,
1516 '_sz is not defined' , // Discards the specific ReferenceError
16- / R e f e r e n c e E r r o r : _ s z i s n o t d e f i n e d / i, // Alternative regex approach
17+ / _ s z / i, // Alternative regex approach
1718 ] ,
1819 denyUrls : [
1920 / g t m \. j s / , // Blocks any error coming from the GTM script
2021 / a p p : \/ \/ \/ g t m \. j s / , // Matches the exact path pattern from your stack trace
2122 ] ,
2223 beforeSend ( event , hint ) {
23- const message = event . exception ?. values ?. [ 0 ] ?. value || ''
24+ const message = event ?. message || event . exception ?. values ?. [ 0 ] ?. value || ''
2425
2526 // Drop the event if it mentions the missing _sz variable
26- if ( message . includes ( '_sz is not defined ' ) ) {
27+ if ( message . includes ( '_sz' ) ) {
2728 return null
2829 }
2930
Original file line number Diff line number Diff line change @@ -13,4 +13,23 @@ Sentry.init({
1313
1414 // Setting this option to true will print useful information to the console while you're setting up Sentry.
1515 debug : false ,
16+ ignoreErrors : [
17+ "Can't find variable: _sz" ,
18+ '_sz is not defined' , // Discards the specific ReferenceError
19+ / _ s z / i, // Alternative regex approach
20+ ] ,
21+ denyUrls : [
22+ / g t m \. j s / , // Blocks any error coming from the GTM script
23+ / a p p : \/ \/ \/ g t m \. j s / , // Matches the exact path pattern from your stack trace
24+ ] ,
25+ beforeSend ( event , hint ) {
26+ const message = event ?. message || event . exception ?. values ?. [ 0 ] ?. value || ''
27+
28+ // Drop the event if it mentions the missing _sz variable
29+ if ( message . includes ( '_sz' ) ) {
30+ return null
31+ }
32+
33+ return event
34+ } ,
1635} )
Original file line number Diff line number Diff line change @@ -12,4 +12,23 @@ Sentry.init({
1212 tracesSampleRate : 1 ,
1313 // Setting this option to true will print useful information to the console while you're setting up Sentry.
1414 debug : false ,
15+ ignoreErrors : [
16+ "Can't find variable: _sz" ,
17+ '_sz is not defined' , // Discards the specific ReferenceError
18+ / _ s z / i, // Alternative regex approach
19+ ] ,
20+ denyUrls : [
21+ / g t m \. j s / , // Blocks any error coming from the GTM script
22+ / a p p : \/ \/ \/ g t m \. j s / , // Matches the exact path pattern from your stack trace
23+ ] ,
24+ beforeSend ( event , hint ) {
25+ const message = event ?. message || event . exception ?. values ?. [ 0 ] ?. value || ''
26+
27+ // Drop the event if it mentions the missing _sz variable
28+ if ( message . includes ( '_sz' ) ) {
29+ return null
30+ }
31+
32+ return event
33+ } ,
1534} )
You can’t perform that action at this time.
0 commit comments