Skip to content

[nextjs] Add option to suppress "could not determine source map reference" warnings for specific files #18872

@skinnymanmusic

Description

@skinnymanmusic

Problem

When using @sentry/nextjs with Next.js 16 and Turbopack, the Source Map Upload Report produces many warnings for files that legitimately don't have source maps:

- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/app/page_client-reference-manifest.js)
- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/interception-route-rewrite-manifest.js)
- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/middleware-build-manifest.js)
- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/next-font-manifest.js)
- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/server-reference-manifest.js)

These files are auto-generated Next.js/Turbopack internals that:

  1. Don't have source maps (by design)
  2. Don't contain user code worth debugging
  3. Create significant noise in CI logs (100+ warnings for larger apps)

Current Workarounds

  • silent: true - Suppresses ALL logs, including useful upload success/failure info
  • sourcemaps.ignore - Only prevents upload, doesn't suppress the warning

Neither provides the desired behavior: suppress warnings for expected missing source maps while keeping visibility into actual upload issues.

Proposed Solution

Add a new option like:

withSentryConfig(nextConfig, {
  sourcemaps: {
    // Suppress warnings for files matching these patterns
    suppressMissingWarnings: [
      '**/*_client-reference-manifest.js',
      '**/*-manifest.js',
    ],
  },
})

Or alternatively, a simpler boolean:

withSentryConfig(nextConfig, {
  sourcemaps: {
    // Don't warn about files without source maps
    warnOnMissing: false,
  },
})

Environment

  • @sentry/nextjs: 10.x (latest)
  • Next.js: 16.1.1
  • Build: Turbopack (default in Next.js 16)
  • pnpm monorepo

Additional Context

These warnings mask real issues in CI logs. When there's an actual source map problem, it's buried in 100+ expected warnings. This defeats the purpose of having verbose logs for debugging.

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions