Logging Errors before App Initialization? #13963
Unanswered
rachel-wesley-sh
asked this question in
Q&A
Replies: 1 comment
-
If this is a major concern, I think the play is to serve your bundle including Sentry.init() separately and make sure it is always the first script executed on the page. Does that make sense? Everything else becomes chicken and egg.
Yes that is exactly what the SDK does, but I don't know how it would help our case here 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have encountered some errors in the past that completely crashed our page during the script parsing phase (due to unsupported features or syntax on some older browsers) and we had no visibility into the issue until it was accidentally discovered. I was wondering how to best handle logging these errors?
I know loaders are an option, but worry about implications of 2 SDKs on the page (in bundle and via loader). I have read a lot in the docs warning of multiple initializations as well as general performance concerns of loading the SDK twice and if we will end up double logging unhandled exceptions. Additionally, because we use React, there are some SPA support integrations that need to be passed in the bundle initialization and other values to update on load.
Is there a way to just make an xhr request to an API endpoint in sentry manually or something similar?
Found similar on StackOver flow: https://stackoverflow.com/questions/60108273/how-do-i-load-sentry-before-the-main-js-bundle-loads -- its 4yrs old and their solve was essentially a custom error logging solution it seems.
Beta Was this translation helpful? Give feedback.
All reactions