Skip to content

Cannot properly use global selector with :is and :where #1208

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

Open
deanveloper opened this issue Oct 22, 2021 · 5 comments
Open

Cannot properly use global selector with :is and :where #1208

deanveloper opened this issue Oct 22, 2021 · 5 comments
Labels
bug Something isn't working upstream

Comments

@deanveloper
Copy link

deanveloper commented Oct 22, 2021

Describe the bug
Svelte language server shows error for :global(:is(.a, .b)), even though it compiles properly.

To Reproduce
(environment: VSCode with Svelte for VSCode extension)

  1. Put :global(:is(.a, .b)) in a component's style.
<script></script>

<style>
:global(:is(.a, .b)) {
   cursor: ew-resize;
}
</style>

Expected behavior
There should not be an error. In fact, building this code is successful.

Screenshots
image

System (please complete the following information):

  • OS: WSL2
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode
@deanveloper deanveloper added the bug Something isn't working label Oct 22, 2021
@deanveloper
Copy link
Author

Related: sveltejs/svelte#4314

@dummdidumm
Copy link
Member

This is a Svelte compiler error, which I can't make appear with the code snippet and using the latest version. Which version of Svelte are you using your project? What happens if you update to the latest version?

@deanveloper
Copy link
Author

deanveloper commented Oct 22, 2021

It works in the REPL: https://svelte.dev/repl/2b3dad5fe375474e9ca412b4c7485e85?version=3.44.0

I am using svelte version 3.44.0

I did notice that I forgot to bring over the closing </style> tag, I've updated the initial report with it now.

@dummdidumm
Copy link
Member

I cannot reproduce this, so I'm thinking that the Svelte package of your project is somehow not found, so the extension falls back to using the one packaged, which is 3.38.3, which contains this error. Bumping that would fix the issue, but the bump is currently blocked by sveltejs/svelte#6728

@deanveloper
Copy link
Author

Hmm, my project is still in its early stages, and I created it using degit. I’m using version 2 of the package-lock (npm 7+) though, maybe that has something to do with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants