From 916b2ad02eb52a0a45a8177bad09dd3527dcf6d8 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 22 Jan 2026 12:45:45 +0100 Subject: [PATCH 1/3] update default ignore --- .../src/config/getBuildPluginOptions.ts | 62 +++++- packages/nextjs/src/config/types.ts | 3 +- .../test/config/getBuildPluginOptions.test.ts | 189 ++++++++++++++---- 3 files changed, 201 insertions(+), 53 deletions(-) diff --git a/packages/nextjs/src/config/getBuildPluginOptions.ts b/packages/nextjs/src/config/getBuildPluginOptions.ts index e43061eb59a5..251e8cde84cf 100644 --- a/packages/nextjs/src/config/getBuildPluginOptions.ts +++ b/packages/nextjs/src/config/getBuildPluginOptions.ts @@ -32,11 +32,18 @@ const FILE_PATTERNS = { GLOB: 'static/chunks/app/**', PATH: 'static/chunks/app', }, - MAIN_CHUNKS: 'static/chunks/main-*', - FRAMEWORK_CHUNKS: 'static/chunks/framework-*', - FRAMEWORK_CHUNKS_DOT: 'static/chunks/framework.*', - POLYFILLS_CHUNKS: 'static/chunks/polyfills-*', - WEBPACK_CHUNKS: 'static/chunks/webpack-*', + MAIN_CHUNKS: '**/main-*', + FRAMEWORK_CHUNKS: '**/framework-*', + FRAMEWORK_CHUNKS_DOT: '**/framework.*', + POLYFILLS_CHUNKS: '**/polyfills-*', + WEBPACK_CHUNKS: '**/webpack-*', + PAGE_CLIENT_REFERENCE_MANIFEST: '**/page_client-reference-manifest.js', + SERVER_REFERENCE_MANIFEST: '**/server-reference-manifest.js', + NEXT_FONT_MANIFEST: '**/next-font-manifest.js', + MIDDLEWARE_BUILD_MANIFEST: '**/middleware-build-manifest.js', + INTERCEPTION_ROUTE_REWRITE_MANIFEST: '**/interception-route-rewrite-manifest.js', + ROUTE_CLIENT_REFERENCE_MANIFEST: '**/route_client-reference-manifest.js', + MIDDLEWARE_REACT_LOADABLE_MANIFEST: '**/middleware-react-loadable-manifest.js', } as const; // Source map file extensions to delete @@ -133,15 +140,25 @@ function createSourcemapUploadIgnorePattern( // We only add main-* files if the user has not opted into it if (!widenClientFileUpload) { - ignore.push(path.posix.join(normalizedDistPath, FILE_PATTERNS.MAIN_CHUNKS)); + ignore.push(FILE_PATTERNS.MAIN_CHUNKS); } // Always ignore these patterns ignore.push( - path.posix.join(normalizedDistPath, FILE_PATTERNS.FRAMEWORK_CHUNKS), - path.posix.join(normalizedDistPath, FILE_PATTERNS.FRAMEWORK_CHUNKS_DOT), - path.posix.join(normalizedDistPath, FILE_PATTERNS.POLYFILLS_CHUNKS), - path.posix.join(normalizedDistPath, FILE_PATTERNS.WEBPACK_CHUNKS), + FILE_PATTERNS.FRAMEWORK_CHUNKS, + FILE_PATTERNS.FRAMEWORK_CHUNKS_DOT, + FILE_PATTERNS.POLYFILLS_CHUNKS, + FILE_PATTERNS.WEBPACK_CHUNKS, + // Next.js internal manifest files that don't have source maps + // These files are auto-generated by Next.js and do not contain user code. + // Ignoring them prevents "Could not determine source map reference" warnings. + FILE_PATTERNS.PAGE_CLIENT_REFERENCE_MANIFEST, + FILE_PATTERNS.SERVER_REFERENCE_MANIFEST, + FILE_PATTERNS.NEXT_FONT_MANIFEST, + FILE_PATTERNS.MIDDLEWARE_BUILD_MANIFEST, + FILE_PATTERNS.INTERCEPTION_ROUTE_REWRITE_MANIFEST, + FILE_PATTERNS.ROUTE_CLIENT_REFERENCE_MANIFEST, + FILE_PATTERNS.MIDDLEWARE_REACT_LOADABLE_MANIFEST, ); return ignore; @@ -216,6 +233,20 @@ function createReleaseConfig( }; } +/** + * Merges default ignore patterns with user-provided ignore patterns. + * User patterns are appended to the defaults to ensure internal Next.js + * files are always ignored while allowing users to add additional patterns. + */ +function mergeIgnorePatterns(defaultPatterns: string[], userPatterns: string | string[] | undefined): string[] { + if (!userPatterns) { + return defaultPatterns; + } + + const userPatternsArray = Array.isArray(userPatterns) ? userPatterns : [userPatterns]; + return [...defaultPatterns, ...userPatternsArray]; +} + /** * Get Sentry Build Plugin options for both webpack and turbopack builds. * These options can be used in two ways: @@ -240,6 +271,9 @@ export function getBuildPluginOptions({ // See: https://www.npmjs.com/package/glob const normalizedDistDirAbsPath = normalizePathForGlob(distDirAbsPath); + // eslint-disable-next-line no-console + console.log('[Sentry DEBUG] getBuildPluginOptions called with:', { buildTool, distDirAbsPath }); + const loggerPrefix = LOGGER_PREFIXES[buildTool]; const widenClientFileUpload = sentryBuildOptions.widenClientFileUpload ?? false; const deleteSourcemapsAfterUpload = sentryBuildOptions.sourcemaps?.deleteSourcemapsAfterUpload ?? false; @@ -250,8 +284,14 @@ export function getBuildPluginOptions({ widenClientFileUpload, ); + // eslint-disable-next-line no-console + console.log('[Sentry DEBUG] sourcemapUploadAssets:', sourcemapUploadAssets); + const sourcemapUploadIgnore = createSourcemapUploadIgnorePattern(normalizedDistDirAbsPath, widenClientFileUpload); + // eslint-disable-next-line no-console + console.log(4, '[Sentry DEBUG] sourcemapUploadIgnore:', sourcemapUploadIgnore); + const filesToDeleteAfterUpload = createFilesToDeleteAfterUploadPattern( normalizedDistDirAbsPath, buildTool, @@ -281,7 +321,7 @@ export function getBuildPluginOptions({ disable: skipSourcemapsUpload ? true : (sentryBuildOptions.sourcemaps?.disable ?? false), rewriteSources: rewriteWebpackSources, assets: sentryBuildOptions.sourcemaps?.assets ?? sourcemapUploadAssets, - ignore: sentryBuildOptions.sourcemaps?.ignore ?? sourcemapUploadIgnore, + ignore: mergeIgnorePatterns(sourcemapUploadIgnore, sentryBuildOptions.sourcemaps?.ignore), filesToDeleteAfterUpload, ...sentryBuildOptions.webpack?.unstable_sentryWebpackPluginOptions?.sourcemaps, }, diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index cdc6e68f053d..46b1aef110d2 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -261,7 +261,8 @@ export type SentryBuildOptions = { /** * A glob or an array of globs that specifies which build artifacts should not be uploaded to Sentry. * - * Default: `[]` + * The SDK automatically ignores Next.js internal files that don't have source maps (such as manifest files) + * to prevent "Could not determine source map" warnings. Your custom patterns are merged with these defaults. * * The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob) * diff --git a/packages/nextjs/test/config/getBuildPluginOptions.test.ts b/packages/nextjs/test/config/getBuildPluginOptions.test.ts index 3e95eadafc96..04602db280f8 100644 --- a/packages/nextjs/test/config/getBuildPluginOptions.test.ts +++ b/packages/nextjs/test/config/getBuildPluginOptions.test.ts @@ -28,11 +28,18 @@ describe('getBuildPluginOptions', () => { sourcemaps: { assets: ['/path/to/.next/server', '/path/to/.next/static/chunks/pages', '/path/to/.next/static/chunks/app'], ignore: [ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ], filesToDeleteAfterUpload: undefined, rewriteSources: expect.any(Function), @@ -116,11 +123,18 @@ describe('getBuildPluginOptions', () => { '/path/to/.next/static/chunks/app/**', ]); expect(result.sourcemaps?.ignore).toEqual([ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ]); expect(result.reactComponentAnnotation).toBeDefined(); }); @@ -138,10 +152,17 @@ describe('getBuildPluginOptions', () => { expect(result.sourcemaps?.assets).toEqual(['/path/to/.next/static/chunks/**']); expect(result.sourcemaps?.ignore).toEqual([ - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ]); }); @@ -156,11 +177,18 @@ describe('getBuildPluginOptions', () => { expect(result._metaOptions?.loggerPrefixOverride).toBe('[@sentry/nextjs - Node.js]'); expect(result.sourcemaps?.assets).toEqual(['/path/to/.next/server/**', '/path/to/.next/serverless/**']); expect(result.sourcemaps?.ignore).toEqual([ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ]); expect(result.reactComponentAnnotation).toBeDefined(); }); @@ -176,11 +204,18 @@ describe('getBuildPluginOptions', () => { expect(result._metaOptions?.loggerPrefixOverride).toBe('[@sentry/nextjs - Edge]'); expect(result.sourcemaps?.assets).toEqual(['/path/to/.next/server/**', '/path/to/.next/serverless/**']); expect(result.sourcemaps?.ignore).toEqual([ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ]); expect(result.reactComponentAnnotation).toBeDefined(); }); @@ -200,11 +235,18 @@ describe('getBuildPluginOptions', () => { '/path/to/.next/static/chunks/app', ]); expect(result.sourcemaps?.ignore).toEqual([ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ]); expect(result.reactComponentAnnotation).toBeUndefined(); }); @@ -223,11 +265,18 @@ describe('getBuildPluginOptions', () => { '/path/to/.next/static/chunks', // Turbopack uses broader pattern ]); expect(result.sourcemaps?.ignore).toEqual([ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ]); expect(result.reactComponentAnnotation).toBeUndefined(); }); @@ -444,7 +493,7 @@ describe('getBuildPluginOptions', () => { expect(result.sourcemaps?.assets).toEqual(customAssets); }); - it('uses custom sourcemap ignore patterns when provided', () => { + it('merges custom sourcemap ignore patterns with defaults', () => { const customIgnore = ['**/vendor/**', '**/node_modules/**']; const sentryBuildOptions: SentryBuildOptions = { org: 'test-org', @@ -461,7 +510,58 @@ describe('getBuildPluginOptions', () => { buildTool: 'webpack-client', }); - expect(result.sourcemaps?.ignore).toEqual(customIgnore); + // Custom patterns should be appended to defaults, not replace them + expect(result.sourcemaps?.ignore).toEqual([ + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', + '**/vendor/**', + '**/node_modules/**', + ]); + }); + + it('handles single string custom sourcemap ignore pattern', () => { + const customIgnore = '**/vendor/**'; + const sentryBuildOptions: SentryBuildOptions = { + org: 'test-org', + project: 'test-project', + sourcemaps: { + ignore: customIgnore, + }, + }; + + const result = getBuildPluginOptions({ + sentryBuildOptions, + releaseName: mockReleaseName, + distDirAbsPath: mockDistDirAbsPath, + buildTool: 'webpack-client', + }); + + // Single string pattern should be appended to defaults + expect(result.sourcemaps?.ignore).toEqual([ + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', + '**/vendor/**', + ]); }); it('disables sourcemaps when disable flag is set', () => { @@ -764,11 +864,18 @@ describe('getBuildPluginOptions', () => { disable: false, assets: ['/path/to/.next/server', '/path/to/.next/static/chunks/pages', '/path/to/.next/static/chunks/app'], ignore: [ - '/path/to/.next/static/chunks/main-*', - '/path/to/.next/static/chunks/framework-*', - '/path/to/.next/static/chunks/framework.*', - '/path/to/.next/static/chunks/polyfills-*', - '/path/to/.next/static/chunks/webpack-*', + '**/main-*', + '**/framework-*', + '**/framework.*', + '**/polyfills-*', + '**/webpack-*', + '**/page_client-reference-manifest.js', + '**/server-reference-manifest.js', + '**/next-font-manifest.js', + '**/middleware-build-manifest.js', + '**/interception-route-rewrite-manifest.js', + '**/route_client-reference-manifest.js', + '**/middleware-react-loadable-manifest.js', ], filesToDeleteAfterUpload: undefined, rewriteSources: expect.any(Function), From 9cdbabe2b4a2031ca9d3371e5cd43921b187aaf8 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 22 Jan 2026 13:52:46 +0100 Subject: [PATCH 2/3] rm logs --- packages/nextjs/src/config/getBuildPluginOptions.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/nextjs/src/config/getBuildPluginOptions.ts b/packages/nextjs/src/config/getBuildPluginOptions.ts index 251e8cde84cf..3d2bcc4595af 100644 --- a/packages/nextjs/src/config/getBuildPluginOptions.ts +++ b/packages/nextjs/src/config/getBuildPluginOptions.ts @@ -270,10 +270,6 @@ export function getBuildPluginOptions({ // glob characters. This clashes with Windows path separators. // See: https://www.npmjs.com/package/glob const normalizedDistDirAbsPath = normalizePathForGlob(distDirAbsPath); - - // eslint-disable-next-line no-console - console.log('[Sentry DEBUG] getBuildPluginOptions called with:', { buildTool, distDirAbsPath }); - const loggerPrefix = LOGGER_PREFIXES[buildTool]; const widenClientFileUpload = sentryBuildOptions.widenClientFileUpload ?? false; const deleteSourcemapsAfterUpload = sentryBuildOptions.sourcemaps?.deleteSourcemapsAfterUpload ?? false; @@ -284,14 +280,8 @@ export function getBuildPluginOptions({ widenClientFileUpload, ); - // eslint-disable-next-line no-console - console.log('[Sentry DEBUG] sourcemapUploadAssets:', sourcemapUploadAssets); - const sourcemapUploadIgnore = createSourcemapUploadIgnorePattern(normalizedDistDirAbsPath, widenClientFileUpload); - // eslint-disable-next-line no-console - console.log(4, '[Sentry DEBUG] sourcemapUploadIgnore:', sourcemapUploadIgnore); - const filesToDeleteAfterUpload = createFilesToDeleteAfterUploadPattern( normalizedDistDirAbsPath, buildTool, From a332750ea4bf9e941d29247b50cd701bb8da1f4a Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 22 Jan 2026 14:37:52 +0100 Subject: [PATCH 3/3] hold my horses --- .../src/config/getBuildPluginOptions.ts | 24 ++--- .../test/config/getBuildPluginOptions.test.ts | 98 +++++++++---------- 2 files changed, 62 insertions(+), 60 deletions(-) diff --git a/packages/nextjs/src/config/getBuildPluginOptions.ts b/packages/nextjs/src/config/getBuildPluginOptions.ts index 3d2bcc4595af..dbc84e88be40 100644 --- a/packages/nextjs/src/config/getBuildPluginOptions.ts +++ b/packages/nextjs/src/config/getBuildPluginOptions.ts @@ -32,11 +32,11 @@ const FILE_PATTERNS = { GLOB: 'static/chunks/app/**', PATH: 'static/chunks/app', }, - MAIN_CHUNKS: '**/main-*', - FRAMEWORK_CHUNKS: '**/framework-*', - FRAMEWORK_CHUNKS_DOT: '**/framework.*', - POLYFILLS_CHUNKS: '**/polyfills-*', - WEBPACK_CHUNKS: '**/webpack-*', + MAIN_CHUNKS: 'static/chunks/main-*', + FRAMEWORK_CHUNKS: 'static/chunks/framework-*', + FRAMEWORK_CHUNKS_DOT: 'static/chunks/framework.*', + POLYFILLS_CHUNKS: 'static/chunks/polyfills-*', + WEBPACK_CHUNKS: 'static/chunks/webpack-*', PAGE_CLIENT_REFERENCE_MANIFEST: '**/page_client-reference-manifest.js', SERVER_REFERENCE_MANIFEST: '**/server-reference-manifest.js', NEXT_FONT_MANIFEST: '**/next-font-manifest.js', @@ -140,15 +140,15 @@ function createSourcemapUploadIgnorePattern( // We only add main-* files if the user has not opted into it if (!widenClientFileUpload) { - ignore.push(FILE_PATTERNS.MAIN_CHUNKS); + ignore.push(path.posix.join(normalizedDistPath, FILE_PATTERNS.MAIN_CHUNKS)); } // Always ignore these patterns ignore.push( - FILE_PATTERNS.FRAMEWORK_CHUNKS, - FILE_PATTERNS.FRAMEWORK_CHUNKS_DOT, - FILE_PATTERNS.POLYFILLS_CHUNKS, - FILE_PATTERNS.WEBPACK_CHUNKS, + path.posix.join(normalizedDistPath, FILE_PATTERNS.FRAMEWORK_CHUNKS), + path.posix.join(normalizedDistPath, FILE_PATTERNS.FRAMEWORK_CHUNKS_DOT), + path.posix.join(normalizedDistPath, FILE_PATTERNS.POLYFILLS_CHUNKS), + path.posix.join(normalizedDistPath, FILE_PATTERNS.WEBPACK_CHUNKS), // Next.js internal manifest files that don't have source maps // These files are auto-generated by Next.js and do not contain user code. // Ignoring them prevents "Could not determine source map reference" warnings. @@ -282,6 +282,8 @@ export function getBuildPluginOptions({ const sourcemapUploadIgnore = createSourcemapUploadIgnorePattern(normalizedDistDirAbsPath, widenClientFileUpload); + const finalIgnorePatterns = mergeIgnorePatterns(sourcemapUploadIgnore, sentryBuildOptions.sourcemaps?.ignore); + const filesToDeleteAfterUpload = createFilesToDeleteAfterUploadPattern( normalizedDistDirAbsPath, buildTool, @@ -311,7 +313,7 @@ export function getBuildPluginOptions({ disable: skipSourcemapsUpload ? true : (sentryBuildOptions.sourcemaps?.disable ?? false), rewriteSources: rewriteWebpackSources, assets: sentryBuildOptions.sourcemaps?.assets ?? sourcemapUploadAssets, - ignore: mergeIgnorePatterns(sourcemapUploadIgnore, sentryBuildOptions.sourcemaps?.ignore), + ignore: finalIgnorePatterns, filesToDeleteAfterUpload, ...sentryBuildOptions.webpack?.unstable_sentryWebpackPluginOptions?.sourcemaps, }, diff --git a/packages/nextjs/test/config/getBuildPluginOptions.test.ts b/packages/nextjs/test/config/getBuildPluginOptions.test.ts index 04602db280f8..f62463447290 100644 --- a/packages/nextjs/test/config/getBuildPluginOptions.test.ts +++ b/packages/nextjs/test/config/getBuildPluginOptions.test.ts @@ -28,11 +28,11 @@ describe('getBuildPluginOptions', () => { sourcemaps: { assets: ['/path/to/.next/server', '/path/to/.next/static/chunks/pages', '/path/to/.next/static/chunks/app'], ignore: [ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -123,11 +123,11 @@ describe('getBuildPluginOptions', () => { '/path/to/.next/static/chunks/app/**', ]); expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -152,10 +152,10 @@ describe('getBuildPluginOptions', () => { expect(result.sourcemaps?.assets).toEqual(['/path/to/.next/static/chunks/**']); expect(result.sourcemaps?.ignore).toEqual([ - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -177,11 +177,11 @@ describe('getBuildPluginOptions', () => { expect(result._metaOptions?.loggerPrefixOverride).toBe('[@sentry/nextjs - Node.js]'); expect(result.sourcemaps?.assets).toEqual(['/path/to/.next/server/**', '/path/to/.next/serverless/**']); expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -204,11 +204,11 @@ describe('getBuildPluginOptions', () => { expect(result._metaOptions?.loggerPrefixOverride).toBe('[@sentry/nextjs - Edge]'); expect(result.sourcemaps?.assets).toEqual(['/path/to/.next/server/**', '/path/to/.next/serverless/**']); expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -235,11 +235,11 @@ describe('getBuildPluginOptions', () => { '/path/to/.next/static/chunks/app', ]); expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -265,11 +265,11 @@ describe('getBuildPluginOptions', () => { '/path/to/.next/static/chunks', // Turbopack uses broader pattern ]); expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -512,11 +512,11 @@ describe('getBuildPluginOptions', () => { // Custom patterns should be appended to defaults, not replace them expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -548,11 +548,11 @@ describe('getBuildPluginOptions', () => { // Single string pattern should be appended to defaults expect(result.sourcemaps?.ignore).toEqual([ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js', @@ -864,11 +864,11 @@ describe('getBuildPluginOptions', () => { disable: false, assets: ['/path/to/.next/server', '/path/to/.next/static/chunks/pages', '/path/to/.next/static/chunks/app'], ignore: [ - '**/main-*', - '**/framework-*', - '**/framework.*', - '**/polyfills-*', - '**/webpack-*', + '/path/to/.next/static/chunks/main-*', + '/path/to/.next/static/chunks/framework-*', + '/path/to/.next/static/chunks/framework.*', + '/path/to/.next/static/chunks/polyfills-*', + '/path/to/.next/static/chunks/webpack-*', '**/page_client-reference-manifest.js', '**/server-reference-manifest.js', '**/next-font-manifest.js',