Skip to content

$$slots is an illegal variable name #5355

Closed
@YerkoPalma

Description

@YerkoPalma

Describe the bug
As the titule say, I can't use $$slots variable

Logs
This shows the error in vscode, even if there is a definition for the $$slots variable

let $$slots: Record<"prefix" | "sufix", boolean>
$$slots is an illegal variable namesvelte(illegal-global)

The error is also logged in the console

✗ client
C:\CLC\VIDA\Web\Comun\ypalma\sapper-cms-template\src\components\Input.svelte
$$slots is an illegal variable name
29:   }
30: 
31:   $: console.log($$slots)
                     ^
32:   const id = label ? label.replace(/ +/g,'-').toLowerCase() : Math.random().toString(36).substring(7)
33: 
✗ server
C:\CLC\VIDA\Web\Comun\ypalma\sapper-cms-template\src\components\Input.svelte
$$slots is an illegal variable name
29:   }
30: 
31:   $: console.log($$slots)
                     ^
32:   const id = label ? label.replace(/ +/g,'-').toLowerCase() : Math.random().toString(36).substring(7)
33: 

To Reproduce
I just tried to use the $$slots variable

Expected behavior
It should have a representation of my component slots, as shown here

Information about your Svelte project:

  • Your browser and the version: Chrome 85.0.4183.83 (64 bit)

  • Your operating system: Window 10

  • Svelte version: 3.24.1

  • Using rollup

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