-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
'too much recursion' hit when injecting Vue-based mixins #6190
Comments
You have to return plain objects in provide: https://jsfiddle.net/posva/nvbyv9wc/ |
This used to work in 2.3.4. It stopped working in 2.4.0. |
@posva what's the meaning behind this note here https://vuejs.org/v2/api/#provide-inject:
I took this to mean that reactive objects were not the default behavior but could be used if implemented. |
@jasonsanjose It means that if you pass down objects that are being observed the injected properties can become reactive: https://jsfiddle.net/4yycfnfm/ |
@posva thanks for the clarification. We'll give that a try. |
I would also like to chime in that I received this issue trying to upgrade to 2.4.x. The regression from 2.3.x with an unhelpful error message made it really hard to track down. I was also not doing anything weird, just copy-pasting this mixin from the vue-hackernews-2.0 project: EDIT: Created vuejs/vue-hackernews-2.0#230 |
i use the element-ui's el-upload compoent with vee-validate, it happens |
@posva we're still looking for a solution. If you have time to chime in we would really appreciate it. If not, hopefully someone else here might have some ideas or at least be in the same situation. Here's my updated example based on your last fiddle: https://jsfiddle.net/jason_sanjose/vzpmtcz2/2/. I added 2 grandchildren Our goal is to mixin properties into a component tree and let them be inherited in some specific way. Here's a contrived example: Let's say we're building a library of form components that can be nested. We want to mixin
For example, say |
@jasonsanjose it's the same problem, the injected |
@posva Thanks for the feedback. We found a "creative" solution: https://jsfiddle.net/jason_sanjose/yc398k68/2/. It involves some watchers on injected properties and a bit of indirection. It's not pretty nor easy to follow but it seems to work in 2.4.2. Hopefully we're still playing within the rules or at least not going to trip over any future behavior changes. |
Here's a better example with cascading breadcrumbs: https://jsfiddle.net/jason_sanjose/sonurrof/2/ |
I still have this problem. mergeData infinitely recurses with empty objects. |
Version
2.4.1
Reproduction link
https://jsfiddle.net/razvansbsb/2z359v28/
Steps to reproduce
What is expected?
Both foo and bar should be available in component B.
What is actually happening?
Get 'too much recursion' exception
The text was updated successfully, but these errors were encountered: