Skip to content

NextJS tries to upload source maps when sourcemaps.disable is set to true #16810

Closed
getsentry/sentry-javascript-bundler-plugins
#753

Description

@rodolfoBee

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

9.34.0

Framework Version

15.3.2

Link to Sentry event

No response

Reproduction Example/SDK Setup

next.config.js file:

export default withSentryConfig(nextConfig, {
org: "...",
project: "...",
authToken:"...",

debug: true,
silent: false,

release:{
    create: false,
},

sourcemaps: {
    disable: true,
},
});

Steps to Reproduce

  1. Configure the SDK as above
  2. Build the app

Expected Result

The SDK does not attempt to upload source maps in any form: https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/build/#sourcemaps.disable

Actual Result

It still tries to upload source maps.

Log:

npm run build           

> 15nexttest@0.1.0 build
> next build

   ▲ Next.js 15.3.2
   - Experiments (use with caution):
     · clientTraceMetadata

   Creating an optimized production build ...
[@sentry/nextjs - Node.js] Info: Using environment variables configured in ".env.sentry-build-plugin".
[@sentry/nextjs - Node.js] Debug: Release injection disabled via `release.inject` option. Will not inject release.
[@sentry/nextjs - Node.js] Debug: The component name annotate plugin is currently disabled. Skipping component name annotations.
[@sentry/nextjs - Node.js] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[@sentry/nextjs - Node.js] Debug: Source map upload was disabled. Will not upload sourcemaps using debug ID process.
[@sentry/nextjs - Node.js] Debug: Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: ...
[same for other files]
> Adding source map references
> Nothing to upload
[@sentry/nextjs - Node.js] Info: Successfully uploaded source maps to Sentry
[@sentry/nextjs - Edge] Info: Using environment variables configured in ".env.sentry-build-plugin".
[@sentry/nextjs - Edge] Debug: Release injection disabled via `release.inject` option. Will not inject release.
[@sentry/nextjs - Edge] Debug: The component name annotate plugin is currently disabled. Skipping component name annotations.
[@sentry/nextjs - Edge] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[@sentry/nextjs - Edge] Debug: Source map upload was disabled. Will not upload sourcemaps using debug ID process.
[@sentry/nextjs - Edge] Debug: Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: ...
[same for other files]
> Found 0 files
> Adding source map references
> Nothing to upload
[@sentry/nextjs - Edge] Info: Successfully uploaded source maps to Sentry
[@sentry/nextjs - Client] Info: Using environment variables configured in ".env.sentry-build-plugin".
[@sentry/nextjs - Client] Debug: Release injection disabled via `release.inject` option. Will not inject release.
[@sentry/nextjs - Client] Debug: The component name annotate plugin is currently disabled. Skipping component name annotations.
[@sentry/nextjs - Client] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[@sentry/nextjs - Client] Debug: Source map upload was disabled. Will not upload sourcemaps using debug ID process.
[@sentry/nextjs - Client] Debug: Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: ...
[same for other files]
> Found 0 files
> Adding source map references
> Nothing to upload
[@sentry/nextjs - Client] Info: Successfully uploaded source maps to Sentry
 ✓ Compiled successfully in 15.0s

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 4, 2025
  2. self-assigned this
    on Jul 4, 2025
  3. proxet-p35 commented on Jul 7, 2025

    @proxet-p35

    Also, I noticed if we don't provide SENTRY_AUTH_TOKEN env variable, because we actually don't wont to interact with Sentry during our CI action where we runnext build, we still have warnings about the missing env variables even if they are not necessary for current configuration.

    [@sentry/nextjs - Node.js] Warning: No auth token provided. Will not create release. Please set the authToken option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
    [@sentry/nextjs - Node.js] Warning: No auth token provided. Will not upload source maps. Please set the authToken option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
    error: Auth token is required for this request. Please run sentry-cli login and try again!

    Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
    Please attach the full debug log to all bug reports.
    [@sentry/nextjs - Node.js] Info: Successfully uploaded source maps to Sentry
    [@sentry/nextjs - Edge] Warning: No auth token provided. Will not create release. Please set the authToken option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
    [@sentry/nextjs - Edge] Warning: No auth token provided. Will not upload source maps. Please set the authToken option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
    error: Auth token is required for this request. Please run sentry-cli login and try again!

    Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
    Please attach the full debug log to all bug reports.
    [@sentry/nextjs - Edge] Info: Successfully uploaded source maps to Sentry
    [@sentry/nextjs - Client] Warning: No auth token provided. Will not create release. Please set the authToken option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
    [@sentry/nextjs - Client] Warning: No auth token provided. Will not upload source maps. Please set the authToken option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
    error: Auth token is required for this request. Please run sentry-cli login and try again!

    Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
    Please attach the full debug log to all bug reports.
    [@sentry/nextjs - Client] Info: Successfully uploaded source maps to Sentry

    Is it also possible not to check for authToken option presence if we are not going to interact with Sentry during the next build when we have the following config?

    export default withSentryConfig(nextConfig, {
      debug: true, // in our CI we have it disabled. I kept it enabled to stay consistent with repro config.
      silent: false,
    
      release:{
          create: false,
      },
      
      sourcemaps: {
          disable: true,
      },
    });

    P.S.: we do not populate SENTRY_AUTH_TOKEN in that CI action run to not expose it when it is not necessary.

  4. chargome commented on Jul 7, 2025

    @chargome
    Member

    Thanks for writing in!

    Ok to sum this up:

    • With sourcemaps.disable: true, no sourcemaps will be generated, uploaded or deleted
    • We still inject the SentryWebpackPlugin but with disabled sourcemaps settings

    That being said I agree that the logs appear to noisy when sourcemaps are disabled (both for upload references and for the auth token) – I'll try to improve this!

  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions