Skip to content

[Nuxt] Cannot set release name used by sentry-vite-plugin #13380

Closed
@darthf1

Description

@darthf1

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nuxt

SDK Version

8.26.0

Framework Version

8.26.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

nuxt.config.ts

import { defineNuxtConfig } from 'nuxt/config'

export default defineNuxtConfig({
  modules: [
    '@sentry/nuxt/module',
  ],

  sentry: {
    debug: import.meta.env.DEV || import.meta.env.CI,
    sourceMapsUploadOptions: {
      enabled: import.meta.env.NUXT_PUBLIC_SENTRY_ENABLED === 'true',
      authToken: import.meta.env.NUXT_PUBLIC_SENTRY_AUTH_TOKEN,
      org: import.meta.env.NUXT_PUBLIC_SENTRY_ORG,
      project: import.meta.env.NUXT_PUBLIC_SENTRY_PROJECT,
      telemetry: false,
    },
  },

  sourcemap: import.meta.env.NUXT_PUBLIC_SENTRY_ENABLED === 'true',
})

sentry.client.config.ts

import { init } from '@sentry/nuxt'

init({
  enabled: import.meta.env.NUXT_PUBLIC_SENTRY_ENABLED === 'true',
  debug: import.meta.env.DEV || import.meta.env.CI,
  dsn: import.meta.env.NUXT_PUBLIC_SENTRY_DSN,
  environment: import.meta.env.NUXT_PUBLIC_SENTRY_ENVIRONMENT,
  release: import.meta.env.NUXT_PUBLIC_SENTRY_RELEASE,
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  // We recommend adjusting this value in production
  tracesSampleRate: 0.2,
  // Capture Replay for 10% of all sessions,
  // plus for 100% of sessions with an error
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1,
})

Steps to Reproduce

During build, sourcemaps are created but there is no release associated with them. Also, there is a warning that no release name is provided. It asks specifically for the key release.name but these cannot be set in the nuxt module options.

Expected Result

A successful build, with sourcemaps associated to a specific release.

Actual Result

#18 223.4 > Uploaded files to Sentry
#18 223.7 > File upload complete (processing pending on server)
#18 223.7 > Organization: [MASKED]
#18 223.7 > Project: [MASKED]
#18 223.7 > Release: undefined
#18 223.7 > Dist: None
#18 223.7 > Upload type: artifact bundle
#18 223.7 
#18 223.7 Source Map Upload Report
#18 223.7   Scripts
#18 223.7     ~/00b0fce5-d98a-45f0-9b02-f9525ea59ccc-123.js (sourcemap at BuzfUGYX.js.map, debug id 00b0fce5-d98a-45f0-9b02-f9525ea59ccc)

--- a lot more

#18 223.8   DEBUG   2024-08-14 12:58:44.356205284 +00:00 skipping update nagger because session is not attended
#18 223.8 [sentry-vite-plugin] Info: Successfully uploaded source maps to Sentry
#18 223.8 ℹ ✓ built in 3m 14s
#18 223.8 ✔ Client built in 193954ms
#18 223.8 /bin/sh: git: not found
#18 223.8 [sentry-vite-plugin] Warning: No release name provided. Will not inject release. Please set the release.name option to identify your release.
#18 223.8 [sentry-vite-plugin] Warning: No release name provided. Will not create release. Please set the release.name option to identify your release.
#18 223.8 ℹ Building server...
#18 223.8 ℹ vite v5.4.0 building SSR bundle for production...

Metadata

Metadata

Assignees

Labels

Package: nuxtIssues related to the Sentry Nuxt SDK

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions