File tree Expand file tree Collapse file tree
packages/nextjs/src/config/wrappers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { GetStaticProps } from 'next' ;
22
3- import { callDataFetcherTraced } from './wrapperUtils' ;
3+ import { isBuild } from '../../utils/isBuild' ;
4+ import { callDataFetcherTraced , withErrorInstrumentation } from './wrapperUtils' ;
45
56type Props = { [ key : string ] : unknown } ;
67
@@ -18,7 +19,13 @@ export function withSentryGetStaticProps(
1819 return async function (
1920 ...getStaticPropsArguments : Parameters < GetStaticProps < Props > >
2021 ) : 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 , {
2229 parameterizedRoute,
2330 dataFetchingMethodName : 'getStaticProps' ,
2431 } ) ;
You can’t perform that action at this time.
0 commit comments