Skip to content

Passing component to nested slots gives TypeError: Cannot read property 'parentNode' of null #3548

Closed
@jmhmd

Description

@jmhmd

Version

3.0.11

Reproduction link

https://codesandbox.io/s/naughty-carson-95syx?file=/src/App.vue

Steps to reproduce

Click the rendered dropdown button with the component included in the slot "popoverContent". Commenting out the component and refreshing gives expected behavior, toggling the popover with "hello".

What is expected?

Expect to be able to render arbitrary content, including other components, in the nested slots.

What is actually happening?

When a component is included in the nested slot content, an error is thrown: "TypeError: Cannot read property 'parentNode' of null."

This error goes away and normal behavior is seen when only text is included in the slot.


I am implementing a custom toolbar with buttons that can be passed content to be displayed in a popover. The component has a slot "popoverContent". then includes a component with a slot "content". The content is passed through those two slots. Including any other component in that slot content produces this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't workinghas workaroundA workaround has been found to avoid the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions