File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/nextjs/src/config/wrappers Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { GetStaticProps } from 'next' ;
2
2
3
- import { callDataFetcherTraced } from './wrapperUtils' ;
3
+ import { isBuild } from '../../utils/isBuild' ;
4
+ import { callDataFetcherTraced , withErrorInstrumentation } from './wrapperUtils' ;
4
5
5
6
type Props = { [ key : string ] : unknown } ;
6
7
@@ -18,7 +19,13 @@ export function withSentryGetStaticProps(
18
19
return async function (
19
20
...getStaticPropsArguments : Parameters < GetStaticProps < Props > >
20
21
) : ReturnType < GetStaticProps < Props > > {
21
- return callDataFetcherTraced ( origGetStaticProps , getStaticPropsArguments , {
22
+ if ( isBuild ( ) ) {
23
+ return origGetStaticProps ( ...getStaticPropsArguments ) ;
24
+ }
25
+
26
+ const errorWrappedGetStaticProps = withErrorInstrumentation ( origGetStaticProps ) ;
27
+
28
+ return callDataFetcherTraced ( errorWrappedGetStaticProps , getStaticPropsArguments , {
22
29
parameterizedRoute,
23
30
dataFetchingMethodName : 'getStaticProps' ,
24
31
} ) ;
You can’t perform that action at this time.
0 commit comments