[Vite] TailwindCSS 2.2 JIT no longer tracks updated Svelte files
See original GitHub issueSince 2.2 (tailwindlabs/tailwindcss#4514) the JIT engine switches to using the “tracking” context by default instead of “watching” context, which requires support in Vite. There’s an issue about this filed at tailwindlabs/tailwindcss#4683 but I figure it’s good to track this here as well.
Current workarounds:
- Use
TAILWIND_MODE=watch
env var, which is ugly and not cross-platform withoutcross-env
, and apparently doesn’t trigger HMR - Start a separate tailwind process with
npm-run-all
- Downgrade tailwind to 2.1
Proper Fix: https://github.com/vitejs/vite/commit/6eaec3ab74d126310d93f8a93f8577bed1c3f474 should in theory fix this, although I can confirm that the CI failing tests on Windows is not a fluke, I can replicate it on my machine.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to use Svelte Kit with Tailwind CSS/JIT (Just-in-time ...
In this tutorial, we'll go through the steps that will allow you to use the latest and greatest version of tailwind with SvelteKit....
Read more >Explicit invoking of Tailwind classes completion doesn't work ...
Write fle inside class and press Ctrl+space to invoke completion explicitly => No suggestions. Delete e , press Ctrl+space => suggestions appear.
Read more >How to set up Svelte using Vite and Tailwind CSS - Medium
Svelte is a JavaScript tool for building UI components. I will not be saying Svelte is a framework here because it is a...
Read more >is a custom class, make sure it is defined within a `@layer ...
The error warning you've posted relates to the use of a dark: -prefixed class - a class that is applied only in "Dark...
Read more >Vite + Vue 3 + TypeScript + Tailwind CSS Starter Template
Notes. In order to take full advance of the new script setup sugar and full TypeScript support in Vue SFC templates (like in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can confirm I’m running into this issue as well. The
TAILWIND_MODE=watch
trick is a lifesaver though 👍I just want to mention that with vite 2.4+, tw JIT does not properly work without the mentioned code above. (Freshly installed sveltekit example with tailwind)