-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
Related issue found. Re-opening, because the author closed it and it's definitely still an issue. - Use the latest release: https://github.com/getsentry/sentry-javascript/releases
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
4.5.4
Description
Using Sentry in an Angular project will cause Angular's change detection to fire any time console.log
is called. This is because of Sentry's breadcrumb feature, which logs whatever was logged to the console, and how that interacts with zone.js
.
I do not understand all of the mechanics behind it, but zone.js
triggers change detection after the code to add a breadcrumb exits. An easy way to prevent the problem would be to wrap console.log
statement to runOutsideAngular
, which prevents zone.js
from running change detection. However, the only two ways of doing would be either wrapping every call to console.log
(which would be very unwieldy and not-obvious) or override the global console.log
function with a different function that calls the original function outside of Angular.
I'm not entirely certain what can be done on Sentry's side to prevent the problem, as any solution would likely be very Angular-specific, in a package meant to be used with a variety of different frameworks. As such, I'm opening issues both here and against the Angular repo.
Edit: angular/angular#28647
Demo repro: https://github.com/ibedard16/sentry-recursion-demo
Instructions on how to run it are in the readme.