JIT mode doesn't load classes
See original GitHub issueWhat version of Tailwind CSS are you using?
2.2.7
What build tool (or framework if it abstracts the build tool) are you using?
vite 2.4.4
What version of Node.js are you using?
14.17.3
What browser are you using?
N/A
What operating system are you using?
macOS
Reproduction repository
https://codesandbox.io/s/hello-vite-forked-l4tu2
Describe your issue
In JIT mode new classes styles dont update when it’s new attributes in classes, using postcss @apply bg-red-500
style works without problems. It persist no matter html pug preprocessor.
If you change class and reload page there are no styling. When you’ll restart process it’ll load up classes.
I tested it on vite with vue, and vite with vue and ruby on rails
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:15 (3 by maintainers)
Top Results From Across the Web
JIT mode doesn't load classes · Discussion #5993 - GitHub
It's working unless you won't use class that doesn't exist in project already (aren't loaded). Like it loads on init and then stop...
Read more >react giving error on tailwind class "bg-[url('/images/bg-header ...
I suspect this is because dynamic attributes only work in JIT mode. Add this to your tailwind.config.js. mode: 'jit'.
Read more >Just-in-Time Mode - Tailwind CSS
When the JIT engine is running in watch mode, you might notice that when you add a class to your HTML then remove...
Read more >How to Use Tailwind's Just-in-Time Mode in Angular
With the new JIT mode, the process is now reversed. The utility classes are generated on demand when we actually use them in...
Read more >The Tailwind CSS “JIT Mode” Bug That Only Happens in ...
The issue is that I'm generating dynamic strings to use for my CSS classes, and that is going to break Tailwind, for reasons...
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
But on codesandbox it works in same way as on my machine, it does update classes but doesn’t styles.
https://user-images.githubusercontent.com/16470866/128415275-20e01bfe-190d-43f3-9d42-8fc088ba03fd.mov
Seems like
TAILWIND_MODE=watch
fixes the thing on codesandbox but can’t confirm in develeopment as this project uses vite_ruby that has problem getting any variable/property from command.@hta218 may I suggest you have a read through the troubleshooting section of the docs, particularly this section:
https://tailwindcss.com/docs/just-in-time-mode#styles-don-t-update-when-saving-content-files
If you’re confident the problem comes from the JIT engine itself, please open an issue with a code repro.
Also, please don’t get frustrated with a feature that is still in preview mode 🙏