Skip to content

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

Closed
@JeppeKnockaert

Description

@JeppeKnockaert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions