question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`at-rule or selector expected `, `semicolon expected`, etc. errors with SelvteKt

See original GitHub issue

Describe the bug When I add vite-plugin-windicss to a SvelteKit project, I receive errors around the WinidiCSS syntax. Certainly the @apply directive, but maybe others. For example:

gnome-shell-screenshot-O4UN90

The actual compile works because things are as expected at runtime.

I’ve seen #98, but I don’t grok a solution other than that issue is fixed.

Side note: @apply’s with only one class are fine.

Minimal Reproductions A minimal reproduction is here: https://github.com/abalmos/windi-sevltekit-min-repo/

Use yarn run dev to start the example and yarn run check to see the errors.

The line in question is: https://github.com/abalmos/windi-sevltekit-min-repo/blob/837fb905e02097db3c69f552a96ae067d8dff6d8/src/routes/index.svelte#L6

Versions

  • vite-plugin-windicss: 1.3.0
  • vite: 2.5.3
  • framework(vue/react/svelte/etc): SvelteKit

Additonal Context

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
abalmoscommented, Sep 6, 2021

@alexanderniebuhr I am using both. I see the same errors in neovim driven by Svelte’s language server and in svelte-check. My original question was a screen shot from neovim, but I added reproduction steps with svelte check to avoid editor differences.

I do believe that svelte-check is working correctly and with preprocessors. It correctly deals with Typescript errors. I have never seen errors in neovim and not in svelte-check and vice versa.

Is this the proper plugin for WindiCSS? Should I be using svelte-windicss-preprocess? Based on the website docs and #98 I decided this was now the proper plugin. I didn’t have much luck with svelte-windicss-preprocess either.

1reaction
alexanderniebuhrcommented, Sep 6, 2021

To use svelte with PostCSS in svelte you would need to use svelte-preprocess. You should also make use that svelte-preprocess is done running before windi css runs. But since you are using site-plugin it should be fine.

I actually can’t reproduce your errors, in any of mine or your repro. Are you sure you are on the latest updates on all extensions.

Another more general setting which helped a lot in the past is:

"css.validate": false,
``
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the at-rule or selector expected error - Stack Overflow
I checked for missing semi-colons, improper indentation, etc; but nothing seems to fix the issue. @charset "UTF-8"; h1 { text-align: center; ...
Read more >
At-rule or Selector expected error- Following Jekyll Tutorial
Hi, I'm following the Jekyll tutorial and I'm having a problem on the Assets step (https://jekyllrb.com/docs/step-by-step/07-assets/).
Read more >
At-rules - CSS: Cascading Style Sheets - MDN Web Docs
At-rules are CSS statements that instruct CSS how to behave. They begin with an at sign, '@' (U+0040 COMMERCIAL AT), followed by an ......
Read more >
PostCSS API
toJSON() // save to file, send by network, etc const root2 = postcss. ... PostCSS cleans selectors, declaration values and at-rule parameters from...
Read more >
selector-max-compound-selectors - Stylelint
Limit the number of compound selectors in a selector. div .bar[data-val] > ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found