File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,16 @@ async function addSentryToEntryProperty(
275275 for ( const entryPointName in newEntryProperty ) {
276276 if ( shouldAddSentryToEntryPoint ( entryPointName , isServer , userSentryOptions . excludeServerRoutes ) ) {
277277 addFilesToExistingEntryPoint ( newEntryProperty , entryPointName , filesToInject ) ;
278+ } else {
279+ if (
280+ isServer &&
281+ // If the user has asked to exclude pages, confirm for them that it's worked
282+ userSentryOptions . excludeServerRoutes &&
283+ // We always skip these, so it's not worth telling the user that we've done so
284+ ! [ 'pages/_app' , 'pages/_document' ] . includes ( entryPointName )
285+ ) {
286+ __DEBUG_BUILD__ && logger . log ( `Skipping Sentry injection for ${ entryPointName . replace ( / ^ p a g e s / , '' ) } ` ) ;
287+ }
278288 }
279289 }
280290
You can’t perform that action at this time.
0 commit comments