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.

JIT mode doesn't load classes

See original GitHub issue

What 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:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
xxSkyycommented, Aug 5, 2021

Hey! Can you provide an actual reproduction repo? CodeSandbox has its own quirks so it’s not the best place to reproduce these types of issues.

I copied your project to a local Vite project and everything is working as expected: Screen.Recording.2021-08-02.at.8.24.12.AM.mov

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.

4reactions
simonswisscommented, Aug 3, 2021

@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 🙏

Read more comments on GitHub >

github_iconTop 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 >

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