-
-
Notifications
You must be signed in to change notification settings - Fork 17
SENTRY_RELEASE and SENTRY_ENVIRONMENT undefined #79
Description
Environment
React app with Netlify deployments
Steps to Reproduce
- While setting up
Sentry.initwith the following params,SENTRY_RELEASEandSENTRY_ENVIRONMENTis undefined.
Sentry.init({
dsn: 'dsn-value',
integrations: [new BrowserTracing()],
tracesSampleRate: 1.0,
release: process.env.SENTRY_RELEASE,
environment: process.env.SENTRY_ENVIRONMENT,
});
In webpack.config.js
plugins: [
new SentryWebpackPlugin({
org: 'some-org',
project: 'some-project',
include: './build',
ignoreFile: '.sentrycliignore',
ignore: ['node_modules', 'webpack.config.js'],
authToken: process.env.SENTRY_AUTH_TOKEN,
release: process.env.SENTRY_RELEASE,
}),
],
The Releases tab in sentry is showing the release and no related issue. Also the environment is available.
But the issue/errors has no release or environment data.
I also looked at the previous resolved issues
- feat: set SENTRY_RELEASE env #11
- https://cra.mr/instrumenting-gatsbyjs-with-sentry/
and tried by settingrelease: process.env.COMMIT_REFbut still undefined.
I also tried using netlify.toml file to set env variables but I specifically need the release which Netlify is sending to sentry (the default value) and it is dynamic every time based on the build, so I am not sure how to set dynamic env vars in netlify.toml
Expected Result
process.env.SENTRY_RELEASE should not be undefined
process.env.SENTRY_ENVIRONMENT should not be undefined
Actual Result
What actually happened. Maybe a screenshot/recording? Maybe some logs?
process.env.SENTRY_RELEASE is undefined/ N/a
process.env.SENTRY_ENVIRONMENT is undefined/ N/a
Please let me know if I have missed anything. Thanks in advance.

