Skip to content

Tailwind CSS v4 not applying styles from component library in monorepo (React + TS + Vite) #18770

Discussion options

You must be logged in to vote

The serif font immediately clues me in that you haven't actually imported the CSS into the app code for the consumer. So, you should add:

import './styles/index.css';

To src/main.tsx or src/App.tsx. This will mean the CSS file would actually be loaded and processed with Tailwind. However, when doing this, we get:

[plugin:@tailwindcss/vite:generate:serve] Package path ./styles/index.css is not exported from package /home/justin/projects/test/Sistema/Cesione.Sistema.Tenant.React/node_modules/cesione.common.react.library (see exports field in /home/justin/projects/test/Sistema/Cesione.Sistema.Tenant.React/node_modules/cesione.common.react.library/package.json)

This shows the CSS is now pro…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@DavidRodriguezSilva
Comment options

@wongjn
Comment options

wongjn Aug 20, 2025
Collaborator

Answer selected by DavidRodriguezSilva
@DavidRodriguezSilva
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants