Skip to content

Svelte 5: $$slots is not defined if runes are used in the component #9683

@scampos-s3d

Description

@scampos-s3d

Describe the bug

When any kind of rune is used in a component, $$slots is not defined so cannot use {#if $$slots}
. Watching the js output seems like the line const $$slots = $.sanitize_slots($$props); is not created. Forcing it with {#if eval('unwrap($$props).children')} makes it work.

Reproduction

Repl

Logs

`$$slots is not defined`

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 30.37 GB / 63.93 GB
  Binaries:
    Node: 18.14.1 - C:\Program Files\nodejs\node.EXE
    npm: 9.3.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.2134.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    svelte: 5.0.0-next.14 => 5.0.0-next.14

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions