Title: Sentry in Vue app causes freeze / 100% CPU usage (inf. recursion) [includes minimal example] · Issue #2957 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry in Vue app causes freeze / 100% CPU usage (inf. recursion) [includes minimal example] · Issue #2957 · getsentry/sentry-javascript
X Title: Sentry in Vue app causes freeze / 100% CPU usage (inf. recursion) [includes minimal example] · Issue #2957 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues #2611 and #2470 seem similar to this, but are not really the same imho Use the latest release: https://gi...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues #2611 and #2470 seem similar to this, but are not really the same...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues #2611 and #2470 seem similar to this, but are not really the same...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/2957
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry in Vue app causes freeze / 100% CPU usage (inf. recursion) [includes minimal example]","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 #2611 and #2470 seem similar to this, but are not really the same imho\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account -> Not needed, reproducible with an arbitrary DSN\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/browser` 5.25\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\nvue 2.6.12\r\nvue-router 3.4.6\r\nbootstrap-vue 2.17.3\r\nsentry-javscript 5.25\r\n```\r\n\r\n## Description\r\n\r\nWe have a Vue application and we encountered an issue when we added sentry. We can reproduce the situation in Chrome/Chromium/Firefox both Linux,Mac and Windows (sometimes the window just freezes without maxing out cpu usage) so it does not seem to be fully platform dependent. I tried to narrow down the issue and I provide a minimal reproducible example (70 lines of html) along with gif recordings of the problem.\r\n\r\nI am open to providing more information, helping with the investigation or even creating a PR if pointed the right way.\r\n\r\n#### The Setup\r\n\r\nThe Vue application uses these libraries:\r\n- vue-router = standard library for displaying views on specific routes\r\n- bootstrap-vue = library with various components which look good (in our example, we use the scrollspy directive which it provides https://bootstrap-vue.org/docs/directives/scrollspy )\r\n\r\nEsentially what we have is a bunch of blocks below each other (left) and a navigation with fixed position (right) which includes a button for each of the blocks on the page. We want to achieve a standard behaviour which includes:\r\n- when you scroll around the page, the currently visible block is highlighted in the navigation\r\n- when you scroll around, your url hash is dynamically updated to reflect the currently scrolled block\r\n- when you click a block in the right menu, you are taken to that block on the page (standard href behaviour)\r\n\r\nSo essentially, it works and looks like this (note the cpu usage in bottom right, as expected some load is on the windowserver but all seems fine):\r\n\r\n\r\n\r\n#### The problem\r\n\r\nThe moment we add sentry, with an existing dsn, or with the example text like this:\r\n\r\n```\r\nSentry.init({\r\n dsn: \"https://examplePublicKey@o0.ingest.sentry.io/0\",\r\n integrations: [new Sentry.Integrations.Vue({ Vue, attachProps: true })],\r\n})\r\n```\r\n\r\nThis is what happens - after a while, the cpu usage of the browser process jumps to 100% and the page starts to lag:\r\n\r\n\r\n\r\nEventually (depends on the machine, but on my mbp2017 it is about 30 secs), the browser console starts to fill with a bunch of errors (call stack size limit exceeded and 429+400 from sentry). During this, we also get rate limited by sentry (in our sentry project, running into this resulted in about 1000 events over those 30 seconds).\r\n\r\n\u003cimg width=\"332\" alt=\"CleanShot 2020-10-07 at 17 32 53@2x\" src=\"https://user-images.githubusercontent.com/1835434/95355189-8baecb80-08c5-11eb-808e-0b9eb8dcdef9.png\">\r\n\r\n\r\n\u003cimg width=\"307\" alt=\"CleanShot 2020-10-07 at 17 33 04@2x\" src=\"https://user-images.githubusercontent.com/1835434/95355173-8782ae00-08c5-11eb-8f2d-d594546f2e6a.png\">\r\n\r\n#### Reproduction\r\n\r\nI am providing a minimal reproducible example for this here (single html file, 70 lines):\r\nhttps://github.com/Zajozor/reproducible/blob/main/sentry-javascript/index.html\r\n\r\n(Be sure to turn off uBlock or other blocker that might block sentry if you try this 😅 )\r\n\r\nThe problem happens when you open the page, and just do what is depicted on the gif above for a while (may take from 5 secs to 20 secs for it to kick in). When you comment the lines 66-69 then the problem disappears (ie. the site has expected cpu usage).\r\n\r\nIt might be that we are doing something wrong in our code, but there is literally no issue with it until you enable sentry.\r\n\r\nThanks for your time :)","author":{"url":"https://github.com/Zajozor","@type":"Person","name":"Zajozor"},"datePublished":"2020-10-07T16:10:02Z","url":"https://github.com/getsentry/sentry-javascript/issues/2957"}
| 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:b8d92f8b-9ea3-460b-a155-f45886e6ac14 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD88:111FC2:141EC:1B799:6B0429AE |
| html-safe-nonce | ad04ae080f76ec5fbaee3bdb240cd3536ad52fd4111f8d81d86ef972b5246e80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDg4OjExMUZDMjoxNDFFQzoxQjc5OTo2QjA0MjlBRSIsInZpc2l0b3JfaWQiOiIyMDE2ODI5ODQyNzA3OTgyNzY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0e3e961ca63db8b8b6d437066b4c6e9c68726b404dfa5163aa5f1cab61db743d |
| hovercard-subject-tag | issue:716665672 |
| 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/2957/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a40cf17f6b8291091cfdbcaf872fdcb7d7569c544c737aeb5280236aaee088d6/getsentry/sentry-javascript/issues/2957 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a40cf17f6b8291091cfdbcaf872fdcb7d7569c544c737aeb5280236aaee088d6/getsentry/sentry-javascript/issues/2957 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues #2611 and #2470 seem similar to this, but are not really the same... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Zajozor |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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