Skip to content

Commit 638afc6

Browse files
committed
Add isBuildCheck to getStaticProps
1 parent 59e64bb commit 638afc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/nextjs/src/config/wrappers/withSentryGetStaticProps.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { GetStaticProps } from 'next';
22

3+
import { isBuild } from '../../utils/isBuild';
34
import { callDataFetcherTraced, withErrorInstrumentation } from './wrapperUtils';
45

56
type Props = { [key: string]: unknown };
@@ -19,6 +20,10 @@ export function withSentryGetStaticProps(
1920
return async function (
2021
...getStaticPropsArguments: Parameters<GetStaticProps<Props>>
2122
): ReturnType<GetStaticProps<Props>> {
23+
if (isBuild()) {
24+
return origGetStaticProps(...getStaticPropsArguments);
25+
}
26+
2227
const errorWrappedGetStaticProps = withErrorInstrumentation(origGetStaticProps);
2328

2429
return callDataFetcherTraced(errorWrappedGetStaticProps, getStaticPropsArguments, {

0 commit comments

Comments
 (0)