chore(sentry): disable Sentry for local development#502
Merged
Conversation
|
|
HAUKI-ADMIN-UI branch is deployed to platta: https://hauki-pr502-admin-ui.dev.hel.ninja 🚀🚀🚀 |
e2e tests result is success for https://hauki-pr502-admin-ui.dev.hel.ninja 😆🎉🎉🎉 |
|
HAUKI-ADMIN-UI branch is deployed to platta: https://hauki-pr502-admin-ui.dev.hel.ninja 🚀🚀🚀 |
e2e tests result is success for https://hauki-pr502-admin-ui.dev.hel.ninja 😆🎉🎉🎉 |
There was a problem hiding this comment.
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()behindSENTRY_DSNbeing present andSENTRY_ENVIRONMENT !== 'local'. - Remove the local-only
tracesSampleRateoverride logic (previously branching onSENTRY_ENV).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Riippi
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.tsxto prevent Sentry from being initialized at all whenSENTRY_ENVIRONMENTis set to'local'. This eliminates the reporting of such transient development-time errors, reducing noise in Sentry without affecting production error monitoring. The redundanttracesSampleRateconfiguration for the local environment has also been removed.Fixes HAUKI-ADMIN-UI-H