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.

šŸž Vite compiler doesn't extract valid classes, even ones rightfully tagged as potential

See original GitHub issue

What happened?

Upon server start, with debug activated, a lot of the classes Iā€™m using are tagged as potential, but then not considered valid nor included in master.css. As you can see in the log, even basic and valid classes like w:100%, t:center, f:12 etc arenā€™t applied. This goes on for every pages or components, the resulting mater.css only have 15 compiled classes.

Then, when I save a page (or component) in VSCode, while the server is running, the HMR updates the page, and there, the styles are taken into account (without further debug infos)

Regarding MasterCssVitePlugin ,I get find the previously existing option to select here the outputed master.css should go, and itā€™s now outputted inside my node_modules/.vite folder, while using pnpm.

Its also seems that the latest beta 95 dosnā€™t include the types definitions for the compiler.

Version

v2.0.0 beta 95 w/ Sveltekit 1.0.1

Relevant log output

āœ“ import master.css.js configuration
15:26:29 [extract] 1 potential src/app.html
15:26:29 [extract] contents
15:26:29 [compile] 1 valid in 0.49ms (1 rules)
15:26:29 [compile] contents
15:26:29 [extract] 23 potential src/routes/+page.svelte
15:26:29 [extract] onMount(() grid-row:1/2 flex flex:col gabX:full w:100% aspect:16/9 obj:cover gabX:col bg:var(--code-background-color) p:20 sticky top:0 z:10 {p:1.5em;flex-basis:full;fg:white;text-decoration:none}>a t:center ai:center jc:center f:12 flex:row fg:white text-decoration:none:hover bg:var(--primary)
15:26:29 [compile] 4 valid in 9.03ms (5 rules)
15:26:29 [compile] contents flex flex:col sticky flex:row
...

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
AristideBHcommented, Dec 23, 2022

Yeah ! Awesome ! Just tested and itā€™s working as intented ! I feel dumb as I donā€™t remember from where I copied this starter fileā€¦

Thanks a lot Aron ā¤ļø

1reaction
1aroncommented, Dec 23, 2022

@AristideBH I found the problem. To remove this line: https://github.com/AristideBH/noise-fr/blob/master/master.css.js#L130 Arrays are now overwritten rather than extended.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Features | Vite
Use the Type-Only Imports and Export syntax to avoid potential problems ... You must set "isolatedModules": true in your tsconfig.json under compilerOptions ......
Read more >
CSS doesn't extract correctly in lib mode since 2.9.10 #8728
Describe the bug Since vite 2.9.10 build in lib mode CSS doesn't extract correctly. So CSS duplicates in style.css and js file.
Read more >
I can't run 'npm run dev' since Laravel updated with Vite
Why can't I user npm run dev and compile my files? This is package.json for my brand new laravel app. { "private": true,...
Read more >
736 kB - Hugging Face
1 Ā·: 1 Ā·their 1 Ā·) 1 Ā·who 1 Ā·- 1 Ā·about 1 Ā·one 1 Ā·up 1 Ā·out 1 Ā·It 1 Ā·all 1...
Read more >
Untitled
#Goldfeder Hi ecards, Scrub a tub cleaners baltimore, Imagenes del ovalo de la alimentacion, Html code color tag, Tatiana lyubimova, Abandonment rate,Ā ...
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