Skip to content

Incorrect "ownership invalid binding" error when using snippets to render children #14893

Closed
@vincenzoml

Description

@vincenzoml

Describe the bug

Issue: checking ownership of values does not "skip" intermediate components that render children using @render, when binding is used in their children from their parent.

Example: in a component in svelte5 have a structure like this:

<ChildComponent>
  <GrandChildComponent bind:statevar />
</ChildComponent>

where ChildComponent uses @render to render its children (that is the GrandChildComponent). In console I get a bogus warning: ownership_invalid_binding suggesting to create a binding between the main component and the ChildComponent. Which is impossible, as ChildComponent is a generic reusable component that renders a child. I also tried, just for the sake of it, to add statevar to the bindable properties of ChildComponent and bind it, and the problem is solved.

I wanted to reproduce it on svelte playground but unfortunately there I don't get ownership warnings.

Reproduction

Before spending time on a minimal reproduction I'd like to get the bug triaged, since it might be a dupe, or a "won't fix" situation and it takes time to create a separate repo just for reproduction. But I will do that immediately if this is a new bug report.

Logs

No response

System Info

System:
    OS: macOS 15.1.1
    CPU: (8) arm64 Apple M1
    Memory: 128.58 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    Yarn: 4.5.1 - ~/.nvm/versions/node/v22.12.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
  Browsers:
    Edge: 131.0.2903.112
    Safari: 18.1.1
  npmPackages:
    svelte: ^5.0.0 => 5.16.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting submitterneeds a reproduction, or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions