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 { hasTracingEnabled } from '@sentry/tracing' ;
2
2
import { GetServerSideProps } from 'next' ;
3
3
4
+ import { isBuild } from '../../utils/isBuild' ;
4
5
import { callTracedServerSideDataFetcher , withErrorInstrumentation } from './wrapperUtils' ;
5
6
6
7
/**
@@ -17,6 +18,10 @@ export function withSentryGetServerSideProps(
17
18
return async function (
18
19
...getServerSidePropsArguments : Parameters < GetServerSideProps >
19
20
) : ReturnType < GetServerSideProps > {
21
+ if ( isBuild ( ) ) {
22
+ return origGetServerSideProps ( ...getServerSidePropsArguments ) ;
23
+ }
24
+
20
25
const [ context ] = getServerSidePropsArguments ;
21
26
const { req, res } = context ;
22
27
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