From 83a767567d5c194e272acadf960db986631ab333 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 10 Oct 2022 09:45:18 +0000 Subject: [PATCH] feat(nextjs): Enable `autoInstrumentServerFunctions` per default --- packages/nextjs/src/config/webpack.ts | 2 +- packages/nextjs/test/integration/next.config.js | 1 - packages/nextjs/test/integration/next10.config.template | 1 - packages/nextjs/test/integration/next11.config.template | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index cfc866cd36da..387d3344b8e8 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -79,7 +79,7 @@ export function constructWebpackConfigFunction( ], }; - if (userSentryOptions.autoInstrumentServerFunctions) { + if (userSentryOptions.autoInstrumentServerFunctions !== false) { const pagesDir = newConfig.resolve?.alias?.['private-next-pages'] as string; // Default page extensions per https://github.com/vercel/next.js/blob/f1dbc9260d48c7995f6c52f8fbcc65f08e627992/packages/next/server/config-shared.ts#L161 diff --git a/packages/nextjs/test/integration/next.config.js b/packages/nextjs/test/integration/next.config.js index a194a9b2bd3d..8992ed63d0e5 100644 --- a/packages/nextjs/test/integration/next.config.js +++ b/packages/nextjs/test/integration/next.config.js @@ -6,7 +6,6 @@ const moduleExports = { }, pageExtensions: ['jsx', 'js', 'tsx', 'ts', 'page.tsx'], sentry: { - autoInstrumentServerFunctions: true, // Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts` // TODO (v8): This can come out in v8, because this option will get a default value hideSourceMaps: false, diff --git a/packages/nextjs/test/integration/next10.config.template b/packages/nextjs/test/integration/next10.config.template index 78d648416c1f..31c332cd25cd 100644 --- a/packages/nextjs/test/integration/next10.config.template +++ b/packages/nextjs/test/integration/next10.config.template @@ -7,7 +7,6 @@ const moduleExports = { }, pageExtensions: ['jsx', 'js', 'tsx', 'ts', 'page.tsx'], sentry: { - autoInstrumentServerFunctions: true, // Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts` // TODO (v8): This can come out in v8, because this option will get a default value hideSourceMaps: false, diff --git a/packages/nextjs/test/integration/next11.config.template b/packages/nextjs/test/integration/next11.config.template index bd177f0d3e82..6a7e849067b1 100644 --- a/packages/nextjs/test/integration/next11.config.template +++ b/packages/nextjs/test/integration/next11.config.template @@ -8,7 +8,6 @@ const moduleExports = { }, pageExtensions: ['jsx', 'js', 'tsx', 'ts', 'page.tsx'], sentry: { - autoInstrumentServerFunctions: true, // Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts` // TODO (v8): This can come out in v8, because this option will get a default value hideSourceMaps: false,