Issue
I set a release value in my Sentry.init call. On the Releases page I still see that release plus other unknown or duplicate releases.
Applies To
All SaaS Customers and Self-Hosted Users
@sentry/nextjsReleases
Source Maps
Resolution
Do not set release in Sentry.init when you use @sentry/nextjs. Set your custom release only in withSentryConfig (or via the SENTRY_RELEASE environment variable).
During the build, withSentryConfig creates a Sentry release for uploaded source maps and injects that release into the client, server, and edge runtimes. If Sentry.init also sets release, that value wins over the injected build release. Events then land on one release name while artifacts sit on another, so you see duplicate or unexpected releases.
Remove
releasefrom everySentry.initcall (client, server, and edge).If you need a custom release name, set it in
next.config.js/next.config.ts:
export default withSentryConfig(nextConfig, {
release: {
name: "[email protected]",
},
});
Rebuild and redeploy so the injected release matches the uploaded artifacts.
You can also set the same value with the SENTRY_RELEASE environment variable. See release.name.
If you must keep release in Sentry.init, make it match release.name / SENTRY_RELEASE exactly. Prefer omitting it from Sentry.init so the build can inject one consistent value.
