This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Svelte: add sentry#63126
Merged
Merged
Conversation
06e5e9d to
b281ebf
Compare
fkling
approved these changes
Jun 7, 2024
fkling
left a comment
Contributor
There was a problem hiding this comment.
🥳 very excited about making better use of this
| import * as Sentry from '@sentry/sveltekit' | ||
|
|
||
| Sentry.init({ | ||
| dsn: window.context.sentryDSN ?? undefined, |
Contributor
There was a problem hiding this comment.
What happens on the sentry side of things when dsn is undefined? And when would it be undefined? Dotcom, cloud, self-hosted?
Member
Author
There was a problem hiding this comment.
I'll add a comment, but sentry is just disabled if the DSN is undefined
Member
Author
There was a problem hiding this comment.
The DSN is settable in site config, and I know it's set by default for dotcom and S2, but I don't think we set it for customer instances. I plan to follow up with the cloud team to ask about that
Contributor
There was a problem hiding this comment.
sentry is just disabled if the DSN is undefined
Good, that's what I hoped. Thank you!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds basic sentry support to the Sveltekit webapp.
Fixes SRCH-90
Additionally, it configures Vite to generate source maps as part of the build so the stack traces in Sentry are readable. I configured it to build public source maps because our source code is already public and this means we don't need to add any special hooks in CI.
Test plan
Created a test project in Sentry and viewed unhandled exceptions from my local installation. Note that Firefox's "Enhanced Tracking Protection" blocks Sentry, as do many adblockers, so it's likely this won't work for many users. I did, however, test that the application still works find even if Sentry fails to load.