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

Unknown Error: Maximum recursive updates exceeded in component #2554

Open
deathmaz opened this issue Nov 26, 2024 · 5 comments
Open

Unknown Error: Maximum recursive updates exceeded in component #2554

deathmaz opened this issue Nov 26, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@deathmaz
Copy link

deathmaz commented Nov 26, 2024

Describe the bug

An error is thrown when running test:

Unknown Error: Maximum recursive updates exceeded in component <TestComponent>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.

It's unclear for me what exactly causes the error, if it's one thing or combination of different things:

  • if this line is commented out the error is not thrown
  • the error is not thrown when this and this lines are commented out
  • i don't have any issues using such component in the browser

To Reproduce

git clone [email protected]:deathmaz/vue-test-issue-repro.git
cd vue-test-issue-repro
npm install
npm run test:unit

Expected behavior

No error is thrown

Related information:

  System:
    OS: Linux 6.6 Manjaro Linux
    CPU: (6) x64 AMD Ryzen 5 4500U with Radeon Graphics
    Memory: 7.77 GB / 15.03 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  npmPackages:
    @vue/test-utils: ^2.4.6 => 2.4.6
    vitest: ^2.1.4 => 2.1.5
    vue: ^3.5.12 => 3.5.13

Additional context

The component in the repro uses @floating-ui/vue package

@deathmaz deathmaz added the bug Something isn't working label Nov 26, 2024
@cexbrayat
Copy link
Member

Hi @deathmaz
OOC have you tried to not stub teleport?

@deathmaz
Copy link
Author

@cexbrayat if I don't stub teleport the error is not thrown, most likely because then the checkbox cannot be "clicked" (because it's teleported) and state is not mutated

@cexbrayat
Copy link
Member

And can you click on the checkbox where it's teleported? (You may have to use attachTo)

@deathmaz
Copy link
Author

@cexbrayat not sure i did exactly what you asked but in deathmaz/vue-test-issue-repro@5b09926 and in deathmaz/vue-test-issue-repro@d2c78ab the error is not thrown, the test is green

@cexbrayat
Copy link
Member

OK, now we know this is a weird interaction between the default teleport stub and floating-ui.
But it's hard to know if this is a problem inside floating-ui or VTU without digging deeper.
If not using a stub solves your issue, I would recommend going with that (except if you're willing to investigate more and open a PR on this repo or floating-ui to solve this issue of course!).

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

No branches or pull requests

2 participants