Skip to content

Svelte 5: transitioned value clears too early #10563

@pooledge

Description

@pooledge

Describe the bug

Please see the REPL.

I could reduce it to the following: if a state/derived variable is referenced inside of an @each loop, a transitioned dependent value becomes undefined too early hence breaking the usual flow of an out transition (illustrated better using @html)

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE2VSTW-DMAz9K242CZAqcWel2g677j6VHjJi2kiQoMRUm6L898VA1247oOC8jzw7CaLTPXpRHYIwckBRiZdxFFtBXyMX_oI9Yaq9nVzLOzvfOj3SvjEN6WG0jiB0UmGEztkBskVRkpPGa9LWZE-JmsitNZ6AD4EaGuGk0rYRN8SOzPYJfPQkCfND9p5tIXvLjgVbEH89EpycncYbLcsWmCF0zro7iwAHPvBYNeKVoUZA_MNmskKnL6jyRb5IijV2N5mWg0Hbo3Szy8orIMyxSGFyQ7hXMxAbsytv0zLhAWV7_ulTerjIfsItaKPwE_J5KSJLd9qMEy3uYWbFtWD39f8jCap5GEvNV1b_GmxD1rRnaU5Yh7yAen9NnGb-r5tlxhRn93K-37DZzGDaCiWHj0sfuoPrfsqq9AXsRBW_gn14PtPQr_CuTNiexbqL6RENVulOoxIVudTSMX4DG4PStn8CAAA=

Not referencing {!!errors} in the template on line 26 restores the expected behaviour.

Logs

No response

System Info

System:
    OS: macOS 12.7.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.50 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
    npm: 9.6.5 - ~/.nvm/versions/node/v18.16.0/bin/npm
    pnpm: 8.15.3 - ~/.nvm/versions/node/v18.16.0/bin/pnpm
    bun: 1.0.23 - ~/.bun/bin/bun
Browsers:
    Chrome: 120.0.6099.234
    Edge: 121.0.2277.128
    Safari: 17.3
npmPackages:
    svelte: ^5.0.0-next.0 => 5.0.0-next.72

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions