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
Open the playground and the console. You will see how the immediate "watcher 2" runs and watcher 1 does the same afterwards (because watcher 2 changes the variable it depends)
Toggle the component: you will see how onScopeDispose from watcher 2 runs, but not the one from watcher 1
What is expected?
Both onScopeDispose callbacks are fired properly and both messages are printed to the console, regardless the immediate status of the watcher
What is actually happening?
The onScopeDispose is properly fired on both
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered:
I don't have a specific solution for this but yes hopefully a debugging hint.
The immediate watcher is triggered even before the component is created. After that, the component is created. Once that happens, the non-immedate watcher is triggered. I assume that the fact this happens later affects the onScopeDispose actual scope, maybe focusing on the watcher itself rather than the component?
I've tried to handle scopes explicitly with effectScope, but the results are exactly the same. The first time the immediate watcher runs it does get the scope. However, the second time (the mounting and creating of the component are done) it does not get the scope.
Either there's something I'm missing about Vue's scoping (which is very possible), or there's probably an actual issue/bug going on here.
Vue version
3.5.13 (also tested on 22dcbf3 in Playground)
Link to minimal reproduction
https://play.vuejs.org/#__PROD__eNqNVE1vGjEQ/SuDLxBpyyptT4hETVOkplI/RJB68WVjhsWJ17bWNqFC/PeObb4LUW/rmTdv5o3fesXurO0vArIBGzrRSuvBoQ/2lmvZWNN6uDeNvYZZaxro9st0igXdHWAFbl4pZV7HOIP1BpkRXAujnYfGBO1xCjcH0J5vA15xPSxzX+pIB4+NVZVHOgEMn4L3RsMnoaR4ueFsz9PZfHJ2OzF1rTD3GJa5JJfn0Rfv5GxfyxmUlB2WB51YwbyjSWey7j87o2kZq0jAmSAGqbD9ab0kJZwNIGViLgn5lmJRSrGNizmKlzPxZ7eMMc5+teiwXSBnu5yv2hp9To8ef+CSvnfJxkyDIvQbyTE6o0KcMcM+Bz2lsQ9wadqHdGNS1xM3WnrUbisqDhqR64TnjK4vLu+S9P24H/ofUx3Xa9rizh2X7bQCox+FsfhFOmscFvBaeTEvDpxRAJHfh7ZF7RP0MPBAfqq0wAtOc7LWlTo22qxSLjqN69SqlzEF9K7g5jaLisVGYV+Zutf9fTe5/zoaw/UAxkF3ulQKJ1P3cu25Mqo6xnaviGCd+pclTObSEQBBKKx0sI5ISJjw6g88oaiCQ5Ae5pUD2TQ4lWTR7f3k8XPrZK1DCVlVf1GpgKR/e6Nnlb0fQGUtyO0uZ/RvTLsFdDr/LroXx7/MIzIa6P+xG6LOCVNaxobmv9dI1OfWWJCBTvYCcbdvvSJTuUgfAN83b0CMljl8/BCs/wIi+bb3
Steps to reproduce
immediate
"watcher 2" runs and watcher 1 does the same afterwards (because watcher 2 changes the variable it depends)onScopeDispose
from watcher 2 runs, but not the one from watcher 1What is expected?
Both
onScopeDispose
callbacks are fired properly and both messages are printed to the console, regardless theimmediate
status of the watcherWhat is actually happening?
The
onScopeDispose
is properly fired on bothSystem Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: