Skip to content

From 5.25.9 I suddendly get ownership_invalid_binding warning #15717

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

Closed
frederikhors opened this issue Apr 9, 2025 · 5 comments · Fixed by #15720
Closed

From 5.25.9 I suddendly get ownership_invalid_binding warning #15717

frederikhors opened this issue Apr 9, 2025 · 5 comments · Fixed by #15720

Comments

@frederikhors
Copy link

frederikhors commented Apr 9, 2025

Describe the bug

I think this warning is a false positive or I do not understand the reason.

Reproduction

https://svelte.dev/playground/92038ae235c244e2a3b31a6c63229323?version=5.25.9

Logs

[svelte] ownership_invalid_binding
List.svelte passed property conditions to Filters.svelte with bind:, but its parent component App.svelte did not declare conditions as a binding. Consider creating a binding between App.svelte and List.svelte (e.g. bind:conditions={...} instead of conditions={...})
https://svelte.dev/e/ownership_invalid_binding

Severity

blocking an upgrade

@yashpandit
Copy link

looks like you are not passing conditions as a bindable prop from App.svelte but expecting it to be one in List.svelte

@frederikhors
Copy link
Author

frederikhors commented Apr 9, 2025

Yeah, but why should I create conditions in App.svelte if I do not need it there?

@yashpandit
Copy link

can't we just declare it as $state in List.svelte then? I am a svelte newbie so I don't fully understand the reason behind making it a bindable in List.svelte

@paoloricciuti
Copy link
Member

can't we just declare it as $state in List.svelte then? I am a svelte newbie so I don't fully understand the reason behind making it a bindable in List.svelte

I think it makes sense for state that is generated by a bindable prop default to not trigger the default but I didn't follow the implementation so I don't know if that's feasible. Will check

@frederikhors
Copy link
Author

can't we just declare it as $state in List.svelte then? I am a svelte newbie so I don't fully understand the reason behind making it a bindable in List.svelte

Sometimes I need to pass that prop from parent to List.svelte.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants