sentry-javascript
sentry-javascript copied to clipboard
add warning when configureScope called before init
Problem Statement
I recently came to a project that uses sentry. Some of my issues don't have user information, and some do. I started investigating the problem, and found that the order of calls to configureScope and init in the code was not guaranteed.
However, I only realized that this was the problem when I found the related issue: https://github.com/getsentry/sentry-javascript/issues/2405
It would be nice if the library warned me that I was doing something wrong.
Solution Brainstorm
If configureScope is called before init it would be possible to print a warning to the console. Wrapping it in __SENTRY_DEBUG__ will not have a significant impact on users, but will improve DX in some cases.