You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
Contains shared UI components and theme
Has its own tailwind.config.js (tried as a workaround / fallback - also didn't fix the issue) and postcss.config.mjs
Uses @source directives in theme.css to scan both app and UI components
Dashboard App (apps/dashboard):
Next.js 15 application
Imports UI package and theme
Uses Turbopack for development and production builds
Attempted Solutions
Configuration Updates:
Updated to latest Tailwind v4.1.5
Implemented recommended @source directives
Configured proper content paths in tailwind.config.js
Added @config directive in theme CSS
Build Process:
Verified proper CSS imports in app's globals.css
Confirmed correct PostCSS configuration
Checked for proper file scanning in development
Monorepo Structure:
Ensured proper workspace configuration
Verified package dependencies
Confirmed correct file paths in configurations
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
Similar issues reported in Tailwind CSS GitHub issues for monorepo setups
Potential connection to file path resolution in monorepo structures
The text was updated successfully, but these errors were encountered:
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?
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
The text was updated successfully, but these errors were encountered: