-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
The never-ending loop will cause a "call stack size exceeded" problem. #4562
Comments
You have |
Yes, I know Vue will not pollute the raw data, but the error message is really weird, I think it is better to throw a much more friendly error message with accurate reason. Some beginners always make mistakes like this, but they do not know how to debug it. |
You are referencing a computed property inside itself - what else do you expect other than an infinite loop? The best we can do is warn you when you define a computed property that clashes with existing properties. |
In case someone else comes here from Google, I was hitting something similar running unit tests but not when running the app normally. I had created a normal computed property (no circular references), but also a a watch created for that computed property. As soon as I commented out the watch, the error went away and unit tests passed. Something like: https://jsfiddle.net/x1jork9c/ |
Vue.js version
2.1.7
Reproduction Link
https://jsfiddle.net/Becavalier/hjdk9e5u/6/
Steps to reproduce
Just run the code.
What is Expected?
Throwing a warning or an error with accurate message.
What is actually happening?
The text was updated successfully, but these errors were encountered: