-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/nuxt
SDK Version
10.38.0
Framework Version
nuxt 4.3.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
nuxt.config.ts:
export default defineNuxtConfig({
modules: [
'@sentry/nuxt/module',
],
compatibilityDate: '2025-07-15',
devtools: { enabled: true },
sentry: {
autoInjectServerSentry: 'top-level-import',
enabled: true,
sourceMapsUploadOptions: {
org: 'sentry',
project: 'my-project',
url: 'https://sentry.example.com',
telemetry: false,
},
},
})
sentry.server.config.ts:
import * as Sentry from '@sentry/nuxt';
Sentry.init({
dsn: 'https://just-a-domain.de/123',
tracesSampleRate: 1.0,
normalizeDepth: 10,
debug: false,
});
Some example api route in server/api/sentry-test to trigger sentry:
import { defineEventHandler } from 'h3';
import * as Sentry from '@sentry/nuxt';
export default defineEventHandler(async () => {
Sentry.captureMessage('My Test', {
level: 'info',
contexts: {
task: { status: 'complete' },
},
});
return {};
});
Steps to Reproduce
Fresh nuxt 4.3.1 installation with:
@sentry/nuxt 10.38.0
dotenv 17.2.4
Adding the following line to .env:
SENTRY_ENVIRONMENT=local
Expected Result
Sentry is logging my event with "environment": "local"
Actual Result
Sentry creates a new Event with "environment": "development" (when using "pnpm run dev") or "production" (when using the build command).
The value for SENTRY_ENVIRONMENT is ignored.
Additional Context
@sentry/nuxt 10.32.1 is the last version where SENTRY_ENVIRONMENT in .env was working.
Since @sentry/nuxt 10.33.0 the value for SENTRY_ENVIRONMENT is completely ignored.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
Status