@@ -2,7 +2,7 @@ import { Carrier, getHubFromCarrier, getMainCarrier } from '@sentry/hub';
22import  {  RewriteFrames  }  from  '@sentry/integrations' ; 
33import  {  configureScope ,  getCurrentHub ,  init  as  nodeInit ,  Integrations  }  from  '@sentry/node' ; 
44import  {  hasTracingEnabled  }  from  '@sentry/tracing' ; 
5- import  {  Event  }  from  '@sentry/types' ; 
5+ import  {  EventProcessor  }  from  '@sentry/types' ; 
66import  {  escapeStringForRegex ,  logger  }  from  '@sentry/utils' ; 
77import  *  as  domainModule  from  'domain' ; 
88import  *  as  path  from  'path' ; 
@@ -71,6 +71,12 @@ export function init(options: NextjsOptions): void {
7171
7272  nodeInit ( options ) ; 
7373
74+   const  filterTransactions : EventProcessor  =  event  =>  { 
75+     return  event . type  ===  'transaction'  &&  event . transaction  ===  '/404'  ? null  : event ; 
76+   } ; 
77+ 
78+   filterTransactions . id  =  'NextServer404Filter' ; 
79+ 
7480  configureScope ( scope  =>  { 
7581    scope . setTag ( 'runtime' ,  'node' ) ; 
7682    if  ( isVercel )  { 
@@ -131,10 +137,6 @@ function addServerIntegrations(options: NextjsOptions): void {
131137  } 
132138} 
133139
134- function  filterTransactions ( event : Event ) : Event  |  null  { 
135-   return  event . type  ===  'transaction'  &&  event . transaction  ===  '/404'  ? null  : event ; 
136- } 
137- 
138140export  type  {  SentryWebpackPluginOptions  }  from  './config/types' ; 
139141export  {  withSentryConfig  }  from  './config' ; 
140142export  {  withSentry  }  from  './utils/withSentry' ; 
0 commit comments