svelte: Bug: "Out" transition blocks component from unmounting indefinitely, caused by update to store

Describe the bug

Discovered this while making my own app which has a global array of objects as state. I noticed that my elements weren’t unmounting due to {#if} statements as I was used to, and narrowed it down to it being due to transitions. It’s a bit strange to explain, but I tried my best isolating the bug.

Reproduction

https://svelte.dev/repl/83c9ee0103da430aa199daadbee12318?version=3.55.1

Notes:

The bug goes away when you remove the out transition (in Comp) The bug does not happen if you inlined the Comp component into App.svelte

This is one of several transition bugs I’ve run into while using Svelte and I have to say, it really makes it hard to love or use. My project is full of transitions and animations, and this stuff not working is a huge deal-breaker and kinda makes me wanna use something else because I simply cannot realize my vision with Svelte. It would be great if the Svelte team could look into this and provide a fix.

System Info

macOS Ventura 13.1
Google Chrome Version 110.0.5481.177 (Official Build) (arm64)
Svelte 3.55.1

Severity

blocking all usage of svelte

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Fixed in Svelte 5

I have encountered this issue in production where a component is getting stuck on the screen when it receives a store update during its out transition. Here is a repl reproducing this bug: https://svelte.dev/repl/8e158d1f24fc4dd08f8bad9808ca6169?version=3.58.0

The requirements to reproduce are an out transition within an if block that depends on a store that is updated after the component is transitioning out due to an external condition.