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: Within mounted component Vue warns about slot outside render function #2135

Open
marina-mosti opened this issue Jul 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@marina-mosti
Copy link
Contributor

marina-mosti commented Jul 21, 2023

Describe the bug

When calling slot content within an onBeforeUpdate hook, Vue will incorrectly warn [Vue warn]: Slot "X" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.

This does not happen outside of VTU tests.
https://play.vuejs.org/#eNqtVdGO0zoQ/ZXZINGuaJPlstK9N2wXAQIJhACxwAvhIZs4rRfHtmynFFX9d2ZsJ03LLrywD1t75ng8c854sk2eap2uO5bkyYWtDNcOLHOdviwkb7UyDrZgWAM7aIxqYYLQyeB6rlod7WlGG4p06D4/8J9HQCEvsnAb3oMbx1otSsdwB3DhkX6Jm94F98rKcSXtoki2UJeuhF2RRFQ8NOwOzjVKjRz0xyVIZh2rwQrlctj2AXejANlBUsE0uuTIH3yU9YEjmSV0RXpjkeCBUG4/v1U1mxFDLZNuBi9NuaTVEc+FzLJgWDmnbZ5lS+5W3XVaqTZDyI3NKmVYdi3UddaWXGa6rL6VS2Yz00nHWzb3fmuqbMWEZgYdTNbMXFFWzt5789/5/M3//xaSbXxyTSc9zbBkjjDPlXSY13QtMWF7ClsqljcwPektBtvFIKGdEOSL2+BNrWrZtFpxUcPiMhyOxyMHwXk6hHGmY3uUd6buh2awWCx6ugZwUwo7Qvc6HZ0auL1/v0ecHFUXTvj/SM9pgN12zVGWuwh9EusNuzySgd3kBYzUVti8Dj4M9MMCplvfgRiH6KElHbkb7wmUZctymOwdkxmZtVHYIfBlQmEmX70taA3TqNs+/xVHbfx1WARCMVVs1f4J/2EYzKCzjC62M1DyGWuwxT5pfEHs9jGxPWqm2bio/kSaxYfi2z7UThaLZffXTZHu4ME3HSnBfMhcyMNMplhz33ERnK5L0WFLHLe2vyVF0JMU9XDcCaL3I/1OUBkMTjL/bmDVfB2ngp+I06vA3RVxFzuEMLCe8wbHV8ynSKASpaWB5qUYDbOT+fziZSwxu5zP954RczmdOgiXDbOpz6hfHQwl3Fr3QzCwldKs9kDfDX2X6LKuuVzm8PAfvXkcbNc4WJZGdbLOcRQ3tTdj2yAvFCvMumHG/9XPCUAvu5/SQfMzJBZDv0INDQo71ptQQewHD1C8GTw8OyP4nRIWbiThaBn1PM99yF+/E3uece0JpLeJksRPFUqS0wG00M+gMCaC4LsEQh4dKiMbvsTnoCRy6csqEpz6mgtm3ukYHlMKEfFKIdT3195G08k/f39mxapvt9hv7IZsRfLeMIsUsiIZfK40+EaC+8XVW7bB9eBsVd0JRP/G+YFZJTrKMcCeYddg2iOcz/aVlx0b7aN9scGnaPuihvHq8UWCbUBC3FX6Pt1H6aPYlrtk9xPxVe9N

To Reproduce

https://stackblitz.com/edit/github-guxdre?file=src%2Fcomponents%2FHelloWorld.vue,src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts,src%2FApp.vue

Expected behavior

Test should pass without throwing warnings.
Is there any current recommended solution to this other than parsing the warnings in jest and removing this one?

Related information:

Additional context

@marina-mosti marina-mosti added the bug Something isn't working label Jul 21, 2023
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

1 participant