Closed
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/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/vue
SDK Version
6.18.2
Framework Version
3.2.31
Link to Sentry event
No response
Steps to Reproduce
main.js
:
import { createApp, h, ref} from 'vue'
import MyComp from './MyComp.vue'
import * as Sentry from '@sentry/vue'
const myComp = ref()
const app = createApp({
render() {
return h(MyComp, { ref: myComp})
}
})
Sentry.init({
app,
dsn: 'some-dsn', // Here you must insert the real "dsn" so that "sentry" will initialize.
environment: 'some-env',
})
app.mount('#app')
MyComp.vue
:
<template>
<div
:data-test="test"
/>
</template>
<script>
export default {
created() {
/* "setTimeout" and "$forceUpdate" are not related to the problem. It's just a way to cause a component
to redraw after a certain amount of time has passed since it was created. */
setTimeout(() => {
this.$forceUpdate()
}, 3000)
}
}
</script>
After redrawing the component ($forceUpdate
), we get the result described below in the actual result
section.
The problem disappears if:
- Do not pass the
ref
param, likereturn h(MyComp)
instead ofreturn h(MyComp, { ref: myComp})
- Use SFC (single file component) instead the render function, like
const app = createApp(App)
, App.vue:
<template>
<my-comp ref="myComp" />
</template>
<script>
import { ref } from 'vue'
import MyComp from './MyComp.vue'
export default {
components: {
MyComp
},
setup() {
const myComp = ref()
return {
myComp
}
}
}
</script>
Expected Result
The application continues to work normally and the console shows this
Actual Result
The application goes into an infinite loop, and the console starts to be continually bombarded with this: