Skip to content
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

False positive ownership_invalid_binding? #15210

Open
donghokimm opened this issue Feb 5, 2025 · 4 comments
Open

False positive ownership_invalid_binding? #15210

donghokimm opened this issue Feb 5, 2025 · 4 comments
Labels

Comments

@donghokimm
Copy link

Describe the bug

I've encountered the ownership_invalid_binding warning while working on a Svelte 5 project.

Reading the documentation was not helpful in fixing this issue.

Can you help me?

Reproduction

REPL

Logs

System Info

System:
  OS: Windows 11 10.0.26100
  CPU: (18) x64 Intel(R) Core(TM) Ultra 5 125H
  Memory: 4.40 GB / 15.74 GB
Binaries:
  Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
  npm: 10.9.0 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
  Edge: Chromium (131.0.2903.99), ChromiumDev (133.0.3014.0)
  Internet Explorer: 11.0.26100.1882

Severity

annoyance

@dummdidumm dummdidumm added the bug label Feb 5, 2025
@dummdidumm
Copy link
Member

The problem is that ownership is not widened correctly - it does not know about the previous owners because it's a class which is not traversed. For proxies we have logic in place for this, for classes we need something similar.

@mcullifer
Copy link

@dummdidumm So what would be the recommendation here? If we know the warning is due to it being class just ignore? Or do you recommend not using classes at all? I think I'm encountering a similar issue to this where I'm using a context which has a class as value. When child components get that context and mutate a property on the class I get the warning.

@dm-de
Copy link

dm-de commented Feb 5, 2025

This warning is confusing and useless.
I found out that it's all about where the value is changed. With snippets you can "bend" that - and the change takes place in other components.

see here:
#14145 (comment)

@donghokimm
Copy link
Author

@dummdidumm
I appreciate the explanation!
Is there a plan to fix it?

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

No branches or pull requests

4 participants