svelte: memory leak: detached nodes are kept when using transitions

Describe the bug

When using transitions something isn’t cleaned up properly resulting in detached nodes memory leak.

Image

This was already fixed once in https://github.com/sveltejs/svelte/issues/12719, so seems to be a regression due to some changes. I am wondering if it’s even possible to have a test or something for it to prevent future regressions.

Reproduction

REPL

  1. Take snapshot
  2. Click button multiple times
  3. Take snapshot again
  4. Repeat and observe h1 leaking

Logs


System Info

Chrome 132.0.6834.160 (Official Build) (arm64)
Svelte 5.19.7

Severity

annoyance

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (17 by maintainers)

Most upvoted comments

@brunnerh looks like the same problem is in Safari as well

Image