Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

SENTRY_RELEASE and SENTRY_ENVIRONMENT undefined #79

@nidhi-tandon

Description

@nidhi-tandon

Environment

React app with Netlify deployments

Steps to Reproduce

  1. While setting up Sentry.init with the following params, SENTRY_RELEASE and SENTRY_ENVIRONMENT is 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.

Screenshot 2023-03-16 at 1 52 26 PM

Screenshot 2023-03-16 at 1 54 59 PM

But the issue/errors has no release or environment data.

I also looked at the previous resolved issues

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions