-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reactive regression on 3.4.15 #10172
Comments
Computed was updated in recent versions, and I believe this is the expected result in your reproduction. You are not supposed to make effects in your computed function. |
Expected. Such usage is explicitly documented as a bad practice: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free |
Sorry for replying to a locked issue, but I just checked my unread email and found that I had forgotten to give a follow-up. This is no longer an issue since 3.4.16. |
Vue version
3.4.15
Link to minimal reproduction
https://play.vuejs.org/#eNqNUttqGzEQ/RWhF7c0XhHcvhg3pC2Btg9taQt90ct2NbGV6MZo5BjM/nukXe9641wICKS5njNntOefQqi2CfiSr2KDOtCFdLALHokpuK6TIbaXjjFVU/3mbf9mDIESusFibFubBEs2+wrG+FnvbcvVnklX7sbbkAjUcqixcX1sxxhtdKy6LuzdRzZj/zwadWg0wh2TpgjS5bMSI/tsENhgaoJsMbbanF/s9wWQte1KZKukT1L4Gde2TDy3dahuondZjY6ZPASi5CNxybNcxZZ8QxTiUohGuVymwOgtVg5IuGDFZU4TmBxpC3Pl7eWiel+dfxBKR5r6K4h2/h/9XQTMXSTPio04Iju3gHMEpwABX4t7UvYA+yT2CH8QNctCsfHuWq9PRCnL1AbwZyDt3UNx6vwB7r53PsIE4zDNBprbJ/w3cdcP9QuhYzYRgGpcA/Xhqz8/YJffY9B6lcxhEc8Ef0P0JhWOfdrn5FSmPcnr2H7rdqzd+m+82hG4OAxViA6f+LCQLy+MfqS7qBajiu09Yuwe7Q==
Steps to reproduce
Just open the reproduction and see the recursive updates in action.
What is expected?
The same as on v3.4.14 and lower: Only one update should occur.
What is actually happening?
The getter modifies the state before returning it, and this triggers reevaluation of the getter after the call, getting it caught in an infinite update loop.
System Info
Any additional comments?
I am fairly confident that this regression was introduced by:
#10123 / bcdecb7
The text was updated successfully, but these errors were encountered: