Skip to main content

[Next.js] How do I debug the source map upload errors I see in my build logs in Vercel?

Issue

When I deploy to Vercel, source map upload fails in the build logs with sentry reported an error: One or more projects are invalid (http status: 400).

Applies To

  • All SaaS Customers and Self-Hosted Users

  • Next.js SDK

  • Vercel

  • Source maps

Resolution

This 400 means Sentry could not find an active project that matches the slug used during source map upload. Enable sentry-cli debug logs, then set SENTRY_ORG and SENTRY_PROJECT (and any org / project values in withSentryConfig) to the current organization and project slugs.

Enable debug logs in Vercel:

  1. In the Vercel project, open Settings > Environment Variables.

  2. Add SENTRY_LOG_LEVEL with the value debug.

  3. Make it available for the environments you deploy, including Production and Preview.

  4. Redeploy.

The next build prints the sentry-cli request URLs. Use those URLs to confirm which organization and project the upload is targeting.

If next.config sets silent: !process.env.CI, Vercel builds stay quiet in the bundler plugin. SENTRY_LOG_LEVEL=debug still prints sentry-cli output. You can also set debug: true on withSentryConfig for extra SDK build logs. See Next.js build options.

Fix the org and project slugs:

  1. In Vercel, open Settings > Environment Variables and copy SENTRY_ORG and SENTRY_PROJECT.

  2. In Sentry, compare those values to the organization slug and project slug, not the display names.

  3. Also check org and project on withSentryConfig in next.config. Hardcoded values override a corrected env var.

  4. Confirm SENTRY_AUTH_TOKEN is present for those same environments. Source map upload runs at build time.

If you renamed the organization or project in Sentry, update SENTRY_ORG and SENTRY_PROJECT in Vercel. Deployment integrations do not update those values for you. See troubleshooting after an organization slug change.

If you use a self-hosted Sentry instance, also set SENTRY_URL (or sentryUrl on withSentryConfig) to that instance.

Redeploy after you change env vars or next.config. When the upload succeeds, remove SENTRY_LOG_LEVEL so later builds stay quieter.

The Vercel integration writes SENTRY_ORG, SENTRY_PROJECT, and SENTRY_AUTH_TOKEN when you link projects. See Vercel project linking.

Did this answer your question?