File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
packages/nextjs/src/config/wrappers Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { GetServerSideProps } from 'next' ;
2
2
3
+ import { isBuild } from '../../utils/isBuild' ;
3
4
import { callTracedServerSideDataFetcher , withErrorInstrumentation } from './wrapperUtils' ;
4
5
5
6
/**
@@ -16,6 +17,10 @@ export function withSentryGetServerSideProps(
16
17
return async function (
17
18
...getServerSidePropsArguments : Parameters < GetServerSideProps >
18
19
) : ReturnType < GetServerSideProps > {
20
+ if ( isBuild ( ) ) {
21
+ return origGetServerSideProps ( ...getServerSidePropsArguments ) ;
22
+ }
23
+
19
24
const [ context ] = getServerSidePropsArguments ;
20
25
const { req, res } = context ;
21
26
Original file line number Diff line number Diff line change 1
1
import { hasTracingEnabled } from '@sentry/tracing' ;
2
2
import { NextPage } from 'next' ;
3
3
4
+ import { isBuild } from '../../utils/isBuild' ;
4
5
import { callTracedServerSideDataFetcher , withErrorInstrumentation } from './wrapperUtils' ;
5
6
6
7
type GetInitialProps = Required < NextPage > [ 'getInitialProps' ] ;
@@ -19,6 +20,10 @@ export function withSentryServerSideGetInitialProps(
19
20
return async function (
20
21
...getInitialPropsArguments : Parameters < GetInitialProps >
21
22
) : Promise < ReturnType < GetInitialProps > > {
23
+ if ( isBuild ( ) ) {
24
+ return origGetInitialProps ( ...getInitialPropsArguments ) ;
25
+ }
26
+
22
27
const [ context ] = getInitialPropsArguments ;
23
28
const { req, res } = context ;
24
29
You can’t perform that action at this time.
0 commit comments