Skip to content

chore(sentry): disable Sentry for local development#502

Merged
Riippi merged 1 commit into
mainfrom
seer/chore/disable-sentry-local
May 29, 2026
Merged

chore(sentry): disable Sentry for local development#502
Riippi merged 1 commit into
mainfrom
seer/chore/disable-sentry-local

Conversation

@sentry

@sentry sentry Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

The root cause analysis for "ReferenceError: t is not defined" revealed that the error was a transient, local development-only issue caused by Vite's Hot Module Replacement (HMR) triggering a re-render while a developer was mid-edit. Sentry was configured to report errors even in the local environment, leading to noise.

This PR updates the Sentry initialization logic in src/index.tsx to prevent Sentry from being initialized at all when SENTRY_ENVIRONMENT is set to 'local'. This eliminates the reporting of such transient development-time errors, reducing noise in Sentry without affecting production error monitoring. The redundant tracesSampleRate configuration for the local environment has also been removed.

Fixes HAUKI-ADMIN-UI-H

@sonarqubecloud

Copy link
Copy Markdown

@azure-pipelines

Copy link
Copy Markdown

HAUKI-ADMIN-UI branch is deployed to platta: https://hauki-pr502-admin-ui.dev.hel.ninja 🚀🚀🚀

@azure-pipelines

Copy link
Copy Markdown

e2e tests result is success for https://hauki-pr502-admin-ui.dev.hel.ninja 😆🎉🎉🎉

@timwessman timwessman marked this pull request as ready for review May 18, 2026 07:07
@timwessman timwessman requested a review from a team as a code owner May 18, 2026 07:07
@azure-pipelines

Copy link
Copy Markdown

HAUKI-ADMIN-UI branch is deployed to platta: https://hauki-pr502-admin-ui.dev.hel.ninja 🚀🚀🚀

@azure-pipelines

Copy link
Copy Markdown

e2e tests result is success for https://hauki-pr502-admin-ui.dev.hel.ninja 😆🎉🎉🎉

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noise in Sentry by preventing Sentry from being initialized in local development when the runtime environment variable SENTRY_ENVIRONMENT is set to 'local'.

Changes:

  • Gate Sentry.init() behind SENTRY_DSN being present and SENTRY_ENVIRONMENT !== 'local'.
  • Remove the local-only tracesSampleRate override logic (previously branching on SENTRY_ENV).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Riippi Riippi merged commit 68a06c9 into main May 29, 2026
29 checks passed
@Riippi Riippi deleted the seer/chore/disable-sentry-local branch May 29, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants