From b6d6e4eced5015a9e678fc05af014b8656ac9cc0 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 13 Feb 2024 14:18:08 +0000 Subject: [PATCH 1/2] fix(nextjs): Remove `webpack://` prefix more broadly from source map `sources` field --- packages/nextjs/src/config/webpack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 75f27bb9e649..dcaa757cb767 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -764,7 +764,7 @@ export function getWebpackPluginOptions( project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, configFile: hasSentryProperties ? 'sentry.properties' : undefined, - stripPrefix: ['webpack://_N_E/'], + stripPrefix: ['webpack://_N_E/', 'webpack://'], urlPrefix, entries: [], // The webpack plugin's release injection breaks the `app` directory - we inject the release manually with the value injection loader instead. release: getSentryRelease(buildId), From f98de4430f78ac2531e2e17ec017e9175a2f270b Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 13 Feb 2024 15:40:24 +0000 Subject: [PATCH 2/2] tests --- packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts b/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts index db17062041c8..ddcc8965a6c1 100644 --- a/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts +++ b/packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts @@ -35,7 +35,7 @@ describe('Sentry webpack plugin config', () => { org: 'squirrelChasers', // from user webpack plugin config project: 'simulator', // from user webpack plugin config authToken: 'dogsarebadatkeepingsecrets', // picked up from env - stripPrefix: ['webpack://_N_E/'], // default + stripPrefix: ['webpack://_N_E/', 'webpack://'], // default urlPrefix: '~/_next', // default entries: [], release: 'doGsaREgReaT', // picked up from env