Tailwind CSS v4 generates inconsistent / invalid utility output in certain environments #20086
Replies: 3 comments
-
|
Consider checking:
Consider providing a git repo that reproduces the issue and we can take a look for you. Currently, your post seems to be too vague and too broad in scope. You can also run a compilation with |
Beta Was this translation helpful? Give feedback.
-
|
This is almost certainly a content detection issue. Tailwind v4 changed how it finds your source files — it uses automatic source detection based on your project's git root and The most common causes of classes silently not generating:
The intermittent behavior (works after restart) points to the watcher not picking up file changes correctly. The Can you share your directory structure and where your CSS entry point lives relative to the git root? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the issue
I’m running into an issue where Tailwind CSS v4 either:
fails to generate expected utilities,
generates incomplete CSS,
or outputs inconsistent styles depending on the environment/build setup.
The issue appears intermittently across different setups (Vite, PostCSS, monorepos, Docker, etc.), which makes debugging difficult.
In some cases:
certain utilities are ignored entirely,
only partial styles apply,
or the generated CSS output becomes invalid/incomplete.
Reproduction
Minimal reproduction:
Tailwind CSS v4
Vite / React / TypeScript setup
Standard installation flow from the docs
Observed behaviour:
Some classes compile correctly
Others silently fail or do not appear in output CSS
Restarting the dev server sometimes changes the behaviour
Expected behaviour
Tailwind should consistently generate all valid utilities regardless of environment or filesystem structure.
Additional context
I’ve tested:
clearing caches,
reinstalling node_modules,
fresh project setup,
switching between PostCSS and Vite plugins,
updating Node.js,
checking content paths/globs,
monorepo vs standalone setups.
The behaviour still persists.
This may be related to:
file scanning/content detection,
v4 source resolution,
watcher behaviour,
or environment-specific caching.
Would appreciate clarification on whether this is:
a known v4 regression,
expected behaviour,
or a configuration issue that needs additional documentation.
Beta Was this translation helpful? Give feedback.
All reactions