Skip to content

$$slots is an illegal variable name #5355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
YerkoPalma opened this issue Sep 4, 2020 · 2 comments
Closed

$$slots is an illegal variable name #5355

YerkoPalma opened this issue Sep 4, 2020 · 2 comments

Comments

@YerkoPalma
Copy link

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

@tivac
Copy link
Contributor

tivac commented Sep 4, 2020

The PR that added $$slots was #4602 and that hasn't been released yet according to the changelog.

https://github.com/sveltejs/svelte/blob/8148a7a33444805320923e4c4e071f62dee3df6c/CHANGELOG.md

@YerkoPalma
Copy link
Author

Oh I see, thanks for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants