question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node bound to object property fails when the property in the object is deleted.

See original GitHub issue

Describe the bug See the title above. For instance the code below fails when the button is clicked.

<script>
     let items = [
          {number: 1, node: null}
     ];
</script>
<p bind:this={items[0].node}>
     {items[0].number}
</p>
<button on:click={()=>items = []}>Delete</button>

There multiple ways the above pattern fails outlined in the REPL below. However, they’re all in the same class of bugs. https://svelte.dev/repl/96355b3f8a45421086f3a4dd0a7163f5?version=3.12.1

Ingore the fact that there are two “App.svelte” files in the REPL above. The code’s the same in both. It’s related to a REPL bug that I’ll file in a separate issue in a bit.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Conduitrycommented, Nov 8, 2019

I think #3211 was the first place it came up.

0reactions
stale[bot]commented, Jun 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript delete object property not working - Stack Overflow
If the object inherits a property from a prototype, and doesn't have the property itself, the property can't be deleted by referencing the...
Read more >
delete operator - JavaScript - MDN Web Docs - Mozilla
The delete operator removes a property from an object. If the property's value is an object and there are no more references to...
Read more >
deleting object properties doesn't trigger a render · Issue #3211
values = Object.values(obj) is not reactive for a delete #3839. Closed. Node bound to object property fails when the property in the object...
Read more >
Error When Deleting Associated Node Properties "Cannot ...
Error When Deleting Associated Node Properties "Cannot delete the property Department. It is still referenced by a node type or viewpoint" ...
Read more >
Learn JavaScript: Objects Cheatsheet - Codecademy
New properties can be added, and existing property values can be changed or deleted. It is the reference to the object, bound to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found