Skip to content

Slot forwarding causes recursion svelte-5 migration #14090

@machycek

Description

@machycek

Describe the bug

When you have a simple component that is forwarding a slot in Svelte 4 and migrate to Svelte 5 it doesn't work correctly. It causes infinite recursion where snippet is calling itself.

Reproduction

https://svelte.dev/playground/hello-world?version=5.1.9#H4sIAAAAAAAAE23LsQrCMBSF4VcJZ1IIdg-x4KaDT9A4pOYKhWsSmlu1lL67ZCg4OJ6P8y-I_kkwOBNzUu80clA7CoNQ2EPjMTAVmG6BzLn-KkBv1SnnQ3kRS7XeF_rn9xSFohQY2Ot8iXmS1kUntnASVYujA_ue2EFV-5lN66JttgoaQh-BkXGi9bZ-Ad0Pq9C-AAAA this is Svelte 4 code and click on migration it produces following https://svelte.dev/playground/hello-world?version=5.1.9#H4sIAAAAAAAAE22OzUrEQBCEX6VphU1CSO4x6nrTgyh43OwhP70QmZ1pZnrVMMy7y-wkePHUUNX1VXnU_ZmwwWdSysC3sWqCjKZZaMqxxNOsyGFz8CgLx78oYLmlnpgr90VKojb0jv7TR6OFtDhssHWjnVkeOt1JXRTxQAH7yJ7oBP5t-KRRArxbw25z2RomKwv4-czGSrZL6F1efeiZmSTAQfUDqWOK1J1eCxIa_JUXkiOKBDxcAxDgHm5jgcvyu0639d9A3b4uL5ovaa2_cakrBbM8RLUTv7ekJ7JJfqxWw9fre4jQDYQlCv0INmIvFI7hF8iH_MR-AQAA

Logs

No response

System Info

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 9.94 GB / 64.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.21 - /usr/local/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    Watchman: 2024.03.25.00 - /usr/local/bin/watchman
  Browsers:
    Brave Browser: 107.1.45.133
    Chrome: 130.0.6723.92
    Safari: 17.6
  npmPackages:
    svelte: ^5.0.0 => 5.1.3

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions