#Avoid creating new release

4 messages · Page 1 of 1 (latest)

visual karma
#

When I build next project it automatically create a release while I have release : { create: false } why?

viscid wraithBOT
#

Hi @visual karma. I'm happy to dig into this for you! I'll check my internal sources for answers to your question! :wave:

#

It appears you're experiencing an issue where releases are still being created automatically despite setting release: { create: false } in your Next.js project with Sentry integration.

This is a known behavior with the Next.js SDK. According to the documentation, there are a few things happening:

  1. The Next.js SDK includes a Webpack plugin that automatically creates releases and uploads source maps during the build process. Even when you disable release creation with release: { create: false }, other mechanisms might still be creating releases.

  2. As mentioned in a GitHub discussion, "The Next.js creates a release by itself" Releases are duplicated. This can happen independently of the GitHub Action or other release creation methods.

  3. There's also a known issue where duplicate releases can be created if you set a release value in your Sentry initialization call while also using the Webpack plugin. According to Sentry's help documentation, "When using the Next.js SDK you should only provide your custom release value in your next.config.js file" Why do I see duplicate or unknown releases?.

To fully prevent release creation, you might need to:

  1. Make sure you set both create: false and finalize: false in your release configuration, as mentioned in a GitHub issue: "I also need to set release.finalize = false because it was trying to finalize the release as well" Ability to disable SentryWebpackPlugin with @sentry/nextjs v8.

  2. Consider disabling Sentry completely in development environments:

Sentry.init({
  enabled: process.env.NODE_ENV === 'production',
  // other options
})
#
  1. You could also try setting a specific release name for development builds to avoid cluttering your production releases.

Note that there's an open GitHub issue requesting a project setting to opt out of creating releases on demand for incoming events Add project setting to opt out of creating Releases on demand for incoming Events, but this feature is not yet available.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: