From e730028fc0f250afa07a4e20ec3a0a0e97dc090f Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 8 Aug 2022 12:35:47 -0700 Subject: [PATCH] move autowrap option into `experiments` object --- packages/nextjs/src/config/types.ts | 8 +++++--- packages/nextjs/src/config/webpack.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index ee7643ef491e..749637b04f90 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -50,9 +50,11 @@ export type UserSentryOptions = { // up uploading too many files, which is why this defaults to `false`. widenClientFileUpload?: boolean; - // Automatically wrap `getServerSideProps`, `getStaticProps`, and `getStaticPaths` in order to instrument them for - // tracing. - autoWrapDataFetchers?: boolean; + experiments?: { + // Automatically wrap `getServerSideProps`, `getStaticProps`, and `getStaticPaths` in order to instrument them for + // tracing. + autoWrapDataFetchers?: boolean; + }; }; export type NextConfigFunction = (phase: string, defaults: { defaultConfig: NextConfigObject }) => NextConfigObject; diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index f1eabb351094..4b750fbe1c6e 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -77,7 +77,7 @@ export function constructWebpackConfigFunction( ], }; - if (userSentryOptions.autoWrapDataFetchers) { + if (userSentryOptions.experiments?.autoWrapDataFetchers) { newConfig.module.rules.push({ test: pageRegex, use: [