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

Bug: Circular references in props cause "Maximum call stack size exceeded" since v2.4.5 #2370

Closed
JeppeKnockaert opened this issue Mar 15, 2024 · 7 comments · Fixed by #2371
Closed
Labels
bug Something isn't working

Comments

@JeppeKnockaert
Copy link

JeppeKnockaert commented Mar 15, 2024

Describe the bug
When a property contains a circular reference, vue-test-utils gets stuck in a loop, resulting in a "Maximum call stack size exceeded" error.

To Reproduce
Failing example (2.4.5): https://stackblitz.com/edit/github-mhdk9j-cpr5hr?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts&view=editor&startScript=test:unit
Working example (2.4.4): https://stackblitz.com/edit/github-mhdk9j-gdhwv2?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts&view=editor&startScript=test:unit

Expected behavior
The test should not crash on circular references, because Vue itself also doesn't crash on this.

Related information:
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh

npmPackages:
@vue/test-utils: ^2.4.4 => 2.4.5
vitest: ^1.3.1 => 1.3.1
vue: ^3.4.21 => 3.4.21

Additional information:

Caused by the deep ref check in https://github.com/vuejs/test-utils/pull/2356/files

@JeppeKnockaert JeppeKnockaert added the bug Something isn't working label Mar 15, 2024
@cexbrayat
Copy link
Member

Hi @JeppeKnockaert

Thanks for the repro.

isDeepRef has been introduced in #2356

@Evobaso-J would you mind taking a look to see if you can fix the regression?

@Evobaso-J
Copy link
Contributor

Sure! I'll try ASAP

@Evobaso-J
Copy link
Contributor

@cexbrayat the fixes are done, but I'd rather take some more time to add several unit tests to isDeepRef.
However, since this looks urgent, I can mark the PR as ready and open a follow-up to add said tests

@cexbrayat
Copy link
Member

@Evobaso-J We're not in a rush, take your time to add tests and ping me when it's ready to review 👍 Thanks for taking a look!

@Evobaso-J
Copy link
Contributor

@cexbrayat ready! ✌🏻

@murilobd
Copy link

murilobd commented Apr 2, 2024

I'm using vue testing library and I'm getting the error reported here (I tested with version 2.4.4 and it was working fine)

@liqueurdetoile
Copy link

@cexbrayat When can we expect this fix to be released ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants