Skip to main content

Monorepo Troubleshooting

Tailwind Classes Missing in Build (v4)​

Context:

  • Tailwind v4 uses automatic source detection.
  • In monorepos, shared package paths may need explicit @source directives.

Related issues:

Option 1: Add @source for shared package paths​

Example (apps/ai-rag-agent/apps/chat/src/app/globals.css):

@import "tailwindcss";
@source "../../../../../../packages/ui/**/*";

Option 2: Keep dynamic classes discoverable​

When class names are fully dynamic, ensure they are represented in static source paths Tailwind scans.

Extra Checks​

  • Confirm target files are not excluded by .gitignore.
  • Confirm shared package path is reachable from the app stylesheet.