Skip to content
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

Replace klona/full to solve the "Maximum call stack size exceeded" issue in Vue 2.7 #1360

Closed
L-orz opened this issue Mar 20, 2024 · 4 comments

Comments

@L-orz
Copy link

L-orz commented Mar 20, 2024

🚀 Feature request

Replace klona/full with deep copy from another library.

🧱 Problem Statement / Justification

I'm trying to implement ark-vue2 based on ark-vue (vue3). Most of it feels good, but I encountered the problem of Maximum call stack size exceeded. After checking, I found that machine internally uses klona/full for deep copying. The Ref in vue2 has a reference property __ob__, which will cause klona to enter an infinite loop.

✅ Proposed solution or API

klona/index / lodash.cloneDeep

↩️ Alternatives

📝 Additional Information

image

@0fatihyildiz
Copy link

I have a similar problem in nextjs.

@segunadebayo
Copy link
Member

Zag.js is primarily built for Vue >=3.

I'll update the docs to make them clearer. I'm sorry about the inconvenience, but I think you should upgrade to Vue 3 instead.

Regarding the issue in Next.js @0fatihyildiz, could you open a new issue with a reproduction? I'm curious to see and fix it. I might consider using structuredClone instead.

@0fatihyildiz
Copy link

Zag.js is primarily built for Vue >=3.

I'll update the docs to make them clearer. I'm sorry about the inconvenience, but I think you should upgrade to Vue 3 instead.

Regarding the issue in Next.js @0fatihyildiz, could you open a new issue with a reproduction? I'm curious to see and fix it. I might consider using structuredClone instead.

Of course, I can create a reprod in a few hours, I will let you know here when it is done. fyi

@L-orz
Copy link
Author

L-orz commented Mar 29, 2024

This may not be specific to vue2, as objects with circular dependencies will also cause errors with klona/full. @segunadebayo
lukeed/klona#44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants