-
Notifications
You must be signed in to change notification settings - Fork 1
Fix the Sentry frontend #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This ensures that sourcemaps will be uploaded during the release build and that events will only upload in the release environment.
Deploying bats-ai with
|
| Latest commit: |
0413599
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://407619e5.bats-ai.pages.dev |
| Branch Preview URL: | https://sentry-frontend.bats-ai.pages.dev |
client/src/main.ts
Outdated
| release: __COMMIT_HASH__, | ||
| }); | ||
| } | ||
| Sentry.init({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like all Sentry SDKs, this has no effect if the DSN isn't defined.
| sentryVitePlugin({ | ||
| org: "kitware-data", | ||
| project: "bats-ai-client", | ||
| release: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the docs, this will also bake the release into future error calls at runtime.
| strictPort: true, | ||
| }, | ||
| build: { | ||
| sourcemap: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be nice for developers to inspect production code in their browser too.
| locals { | ||
| www_env_vars = { | ||
| VITE_APP_API_ROOT = "https://${module.django.fqdn}" | ||
| VITE_APP_SENTRY_DSN = "https://a224627951abd0f0606d8578cacef5d6@o267860.ingest.us.sentry.io/4510829950730240" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branch previews shouldn't have a DSN, to avoid creating Sentry spam for PR content.
This ensures that sourcemaps will be uploaded during the release build and that events will only upload in the release environment.