You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
π The bug
When using useRoute() and a watcher it throws a "This must be called within a setup function" error when browsing inside the app
π οΈ To reproduce
Declare route and add a watcher inside a setup function
export default defineComponent({
setup() {
const route = useRoute()
watch(route, (to) => {
// do something with the watch
})
}
})
First load is ok but it crashes when changing page inside the nuxt app
π Expected behaviour
I don't know if there is a workaround for this situation or a bug to be fixed. My understanding is that vue getCurrentInstance() has many limitation and poor documentation except for that one doc that warns that it shouldn't be used at all (only found on that ru version of vue documentation).
The text was updated successfully, but these errors were encountered:
π The bug
When using useRoute() and a watcher it throws a "This must be called within a setup function" error when browsing inside the app
π οΈ To reproduce
Declare route and add a watcher inside a setup function
export default defineComponent({
setup() {
const route = useRoute()
watch(route, (to) => {
// do something with the watch
})
}
})
First load is ok but it crashes when changing page inside the nuxt app
π Expected behaviour
I don't know if there is a workaround for this situation or a bug to be fixed. My understanding is that vue
getCurrentInstance()
has many limitation and poor documentation except for that one doc that warns that it shouldn't be used at all (only found on that ru version of vue documentation).The text was updated successfully, but these errors were encountered: