Skip to content

Vue warns incorrectly if component is surrounded by functional component #3257

Open
@plehnen

Description

@plehnen

Version

3.0.5

Reproduction link

https://codesandbox.io/s/vue3-slot-invoked-outside-warning-demo-ezuud

Steps to reproduce

Please have a look at the minimal reproduction.

As soon as I create a component inside of a "functional component", it show's a warning.

What is expected?

It shouldn't warn.

What is actually happening?

[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.


The warning is only shown if I create the watch in MyComponent.vue (or if I access isMandatoryOrSlotVisible.value directly.)
If I use the same code without the surrounding MyContainer component, it work's without any warning. Since there is no invokation of the slot function in the surrounding MyContainer component, the warning is misleading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🧹 p1-chorePriority 1: this doesn't change code behavior.🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions