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

svelte set bound property to undefined when destroy the list component #13025

Open
NikolayMakhonin opened this issue Aug 26, 2024 · 1 comment

Comments

@NikolayMakhonin
Copy link

NikolayMakhonin commented Aug 26, 2024

Describe the bug

Svelte sets the value of a bound property to undefined when it removes a list component. Thus, simply opening/closing a window can damage the data.

I created a minimal example to reproduce this error. If you remove or simplify anything else there, the error will most likely stop appearing.

When you press the button, this code is executed:

items.set([new ItemData()])
showList.set(false)

The items list is completely changed, and we immediately hide the list component.

Next, you can see in the console that the value property was set to undefined, but I didn't ask for this.

Reproduction

https://svelte.dev/repl/ba76a57dd23847e7a0be5123cfe28d22?version=4.2.19

  • click the Change Items button
  • see in the console, that the property value was set to undefined

Logs

No response

System Info

https://svelte.dev/repl/ba76a57dd23847e7a0be5123cfe28d22?version=4.2.19
Google Chrome Version 127.0.6533.120
Microsoft Windows [Version 10.0.19045.4780]

Severity

annoyance

@paoloricciuti
Copy link
Member

This seems to be fixed by svelte 5

REPL

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

No branches or pull requests

2 participants