Tailwind utility classes not generated in monorepo #17905
Unanswered
falkmatt91
asked this question in
Help
Replies: 2 comments 1 reply
-
What was the old version of Tailwind CSS before you updated to v4.1.5? Could you also provide a git repo that reproduces the unexpected behavior please? |
Beta Was this translation helpful? Give feedback.
0 replies
-
sure - old version was |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Tailwind CSS v4.1.5 Monorepo Issue: Missing Utility Classes in Production Build
Environment Details
What version of Tailwind CSS are you using?
v4.1.5
What build tool (or framework if it abstracts the build tool) are you using?
Next.js 15 with Turbopack
What version of Node.js are you using?
v23
What browser are you using?
Chrome latest
What operating system are you using?
macOS
Monorepo Structure
Describe your issue
After upgrading to Tailwind CSS v4.1.5, utility classes are not being generated in the production build, despite following all recommended configurations and best practices. The issue appears to be related to how Tailwind processes files in a monorepo structure.
Current Setup
UI Package (
packages/ui
):tailwind.config.js
(tried as a workaround / fallback - also didn't fix the issue) andpostcss.config.mjs
@source
directives intheme.css
to scan both app and UI componentsDashboard App (
apps/dashboard
):Attempted Solutions
Configuration Updates:
@source
directivestailwind.config.js
@config
directive in theme CSSBuild Process:
globals.css
Monorepo Structure:
Expected Behavior
Utility classes should be generated and included in the production build, as they are in development.
Actual Behavior
Production build CSS only contains theme variables and base styles, but no utility classes (like
.bg-red-500
,.text-white
, etc.).Additional Context
This issue appears to be related to how Tailwind v4.1.5 processes files in a monorepo structure, particularly with the
@source
directive and file path resolution. The problem persists despite following all official documentation and best practices for Tailwind v4 monorepo setups.Reproduction Steps
tbd
Related Issues
Beta Was this translation helpful? Give feedback.
All reactions