sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

add warning when configureScope called before init

Open dartess opened this issue 3 years ago • 0 comments

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.

dartess avatar Aug 20 '22 11:08 dartess