Title: Angular Integration Issue - console.log calls cause Change detection to run · Issue #1883 · getsentry/sentry-javascript · GitHub
Open Graph Title: Angular Integration Issue - console.log calls cause Change detection to run · Issue #1883 · getsentry/sentry-javascript
X Title: Angular Integration Issue - console.log calls cause Change detection to run · Issue #1883 · getsentry/sentry-javascript
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...
Open Graph 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...
X 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...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/1883
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular Integration Issue - console.log calls cause Change detection to run","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n[Related issue found](https://github.com/getsentry/sentry-javascript/issues/1800). Re-opening, because the author closed it and it's definitely still an issue.\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/browser`\r\n- [ ] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [ ] other:\r\n\r\n### Version:\r\n\r\n```\r\n4.5.4\r\n```\r\n\r\n## Description\r\nUsing Sentry in an [Angular](https://github.com/angular/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`.\r\n\r\nI 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.\r\n\r\nI'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.\r\n\r\nEdit: https://github.com/angular/angular/issues/28647\r\n\r\nDemo repro: https://github.com/ibedard16/sentry-recursion-demo\r\nInstructions on how to run it are in the [readme](https://github.com/ibedard16/sentry-recursion-demo#the-demo).","author":{"url":"https://github.com/ibedard16","@type":"Person","name":"ibedard16"},"datePublished":"2019-02-11T18:48:02Z","url":"https://github.com/getsentry/sentry-javascript/issues/1883"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e83173fb-1521-f32e-95b9-e5ec3c5ae787 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C198:36DAFB:6FB6C7:9DC674:6B044D74 |
| html-safe-nonce | dfe03e579d20e10092a6438a6ccdf3c2c68aa3659e7b2fa78be389c0f7afd18c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTk4OjM2REFGQjo2RkI2Qzc6OURDNjc0OjZCMDQ0RDc0IiwidmlzaXRvcl9pZCI6IjkxMTE5Njg3MDQ0ODAxNjkzMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d9e277a2b7b0a025063853707af2f1e9964bdd5ae049a2fbc7e7fccddc182ee7 |
| hovercard-subject-tag | issue:408923398 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/1883/issue_layout |
| twitter:image | https://opengraph.githubassets.com/231957ac2e6556dce2e95188b3adf79234c17d76e448d1e84f8182d52a37416d/getsentry/sentry-javascript/issues/1883 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/231957ac2e6556dce2e95188b3adf79234c17d76e448d1e84f8182d52a37416d/getsentry/sentry-javascript/issues/1883 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ibedard16 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width