Bug: Within mounted component Vue warns about slot outside render function
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 291
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 18
Description
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.
To Reproduce
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction files src/components/HelloWorld.vue, src/components/tests/HelloWorld.spec.ts, and src/App.vue from the linked StackBlitz project. Run the test and inspect how the mounted component invokes slot content during onBeforeUpdate. Done means the test passes without the reported slot warning, with coverage for this behavior in the relevant test file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100