File tree 1 file changed +9
-4
lines changed
packages/nextjs/src/config/templates
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,16 @@ const origGetInitialProps = pageComponent.getInitialProps;
26
26
const origGetStaticProps = userPageModule . getStaticProps ;
27
27
const origGetServerSideProps = userPageModule . getServerSideProps ;
28
28
29
+ const getInitialPropsWrappers : Record < string , any > = {
30
+ '/_app' : Sentry . withSentryServerSideAppGetInitialProps ,
31
+ '/_document' : Sentry . withSentryServerSideDocumentGetInitialProps ,
32
+ '/_error' : Sentry . withSentryServerSideErrorGetInitialProps ,
33
+ } ;
34
+
35
+ const getInitialPropsWrapper = getInitialPropsWrappers [ '__ROUTE__' ] || Sentry . withSentryServerSideGetInitialProps ;
36
+
29
37
if ( typeof origGetInitialProps === 'function' ) {
30
- pageComponent . getInitialProps = Sentry . withSentryServerSideGetInitialProps (
31
- origGetInitialProps ,
32
- '__ROUTE__' ,
33
- ) as NextPageComponent [ 'getInitialProps' ] ;
38
+ pageComponent . getInitialProps = getInitialPropsWrapper ( origGetInitialProps ) as NextPageComponent [ 'getInitialProps' ] ;
34
39
}
35
40
36
41
export const getStaticProps =
You can’t perform that action at this time.
0 commit comments