Title: Infinite loop when using the render function and the ref parameter. · Issue #4743 · getsentry/sentry-javascript · GitHub
Open Graph Title: Infinite loop when using the render function and the ref parameter. · Issue #4743 · getsentry/sentry-javascript
X Title: Infinite loop when using the render function and the ref parameter. · Issue #4743 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4743
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Infinite loop when using the render function and the ref parameter.","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which package are you using?\n\n@sentry/vue\n\n### SDK Version\n\n6.18.2\n\n### Framework Version\n\n3.2.31\n\n### Link to Sentry event\n\n_No response_\n\n### Steps to Reproduce\n\n`main.js`:\r\n```\r\nimport { createApp, h, ref} from 'vue'\r\nimport MyComp from './MyComp.vue'\r\nimport * as Sentry from '@sentry/vue'\r\n\r\nconst myComp = ref()\r\nconst app = createApp({\r\n render() {\r\n return h(MyComp, { ref: myComp})\r\n }\r\n})\r\nSentry.init({\r\n app,\r\n dsn: 'some-dsn', // Here you must insert the real \"dsn\" so that \"sentry\" will initialize.\r\n environment: 'some-env',\r\n})\r\napp.mount('#app')\r\n```\r\n\r\n`MyComp.vue`:\r\n```\r\n\u003ctemplate>\r\n \u003cdiv\r\n :data-test=\"test\"\r\n />\r\n\u003c/template>\r\n\r\n\u003cscript>\r\n\r\nexport default {\r\n created() {\r\n /* \"setTimeout\" and \"$forceUpdate\" are not related to the problem. It's just a way to cause a component \r\n to redraw after a certain amount of time has passed since it was created. */\r\n setTimeout(() => {\r\n this.$forceUpdate()\r\n }, 3000)\r\n }\r\n}\r\n\u003c/script>\r\n```\r\n\r\nAfter redrawing the component (`$forceUpdate`), we get the result described below in the `actual result` section.\r\n\r\nThe problem disappears if:\r\n\r\n* Do not pass the `ref` param, like `return h(MyComp)` instead of `return h(MyComp, { ref: myComp})`\r\n* Use SFC (single file component) instead the render function, like `const app = createApp(App)`, App.vue:\r\n\r\n```\r\n\u003ctemplate>\r\n \u003cmy-comp ref=\"myComp\" />\r\n\u003c/template>\r\n\r\n\u003cscript>\r\nimport { ref } from 'vue'\r\nimport MyComp from './MyComp.vue'\r\nexport default {\r\n components: {\r\n MyComp\r\n },\r\n setup() {\r\n const myComp = ref()\r\n return {\r\n myComp\r\n }\r\n }\r\n}\r\n\u003c/script>\r\n```\r\n\n\n### Expected Result\n\nThe application continues to work normally and the console shows this\r\n\r\n\n\n### Actual Result\n\nThe application goes into an infinite loop, and the console starts to be continually bombarded with this:\r\n\r\n","author":{"url":"https://github.com/schoonc","@type":"Person","name":"schoonc"},"datePublished":"2022-03-21T16:07:35Z","url":"https://github.com/getsentry/sentry-javascript/issues/4743"}
| 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:4b3ded4d-5725-48c9-4423-7bb28f076135 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD0A:44B64:4D661:6AE16:6B046BB1 |
| html-safe-nonce | a77fdeda139cdd8c1dbe0f0145ac6b5860062e2c6d92ac9902538efd964f1e54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDBBOjQ0QjY0OjRENjYxOjZBRTE2OjZCMDQ2QkIxIiwidmlzaXRvcl9pZCI6IjQzODU1NDkxODg4NjAyNDI4NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0fd121f01183ae682861354f67aee7c1f95194cc740d3fb43c45847939ed0125 |
| hovercard-subject-tag | issue:1175608160 |
| 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/4743/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0179bbc6447a3af8401f277a6941f2d1256c41966b77f96f92cb073b972ef339/getsentry/sentry-javascript/issues/4743 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0179bbc6447a3af8401f277a6941f2d1256c41966b77f96f92cb073b972ef339/getsentry/sentry-javascript/issues/4743 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | schoonc |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| 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