-
Notifications
You must be signed in to change notification settings - Fork 4.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
@tailwindcss/vite@^4.0.8
is not able to find classes from component based config and components
#16939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same problem. the upgrade from 4.0.7 to 4.0.8 or 4.0.9 broke everything. We are using npm instead of pnpm and macOS instead of Linux, but the issue is the same. |
@nachoaldamav Hey! If I understand you correctly you want one npm package pnpm does indeed move things around with the core assumption that So I think there's two options to making this work:
I was trying to look at your repro to confirm that these indeed fix the issue but for me (using pnpm 10.5.2) the button seems to work fine but I may be missing somethign: ![]() @cvlmtg Mind sharing a reproduction of your setup so we can take a look? |
@philipp-spiess Hi, yes, you are correct, the config does not have dependencies because in my setup (I had to simplify it so you could debug it) this will cause a cyclic dependencies issue (in short config > component > config). I think the Module Graph scanner was a huge feature that eases this stuff by not needing to explicitly set a About the reproduction, it's explained in the readme, these are the steps:
edit: for context, the config would work as a shareable config, I'm not thinking about it to register components paths, but for the styling, plugins, etc... I think the way to see it is that in my setup every component acts as a standalone app (for previews, like Storybook) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What version of Tailwind CSS are you using?
v4.0.9
(4.0.7
works fine)What build tool (or framework if it abstracts the build tool) are you using?
6.2.0
What version of Node.js are you using?
v22.13.1
What browser are you using?
Chrome
What operating system are you using?
Debian (WSL2)
Reproduction URL
https://github.com/nachoaldamav/tailwind-debug-4.0.9
Describe your issue
With the change from the PR #16631 loading config files and component as packages break the candidates search.
Key points
@my-org/tailwind-config/styles.css
.@my-org/button
.@source "../node_modules/@my-org/button
would fix it, but it doesn't.node_modules
structure, as the config file is not loaded fromnode_modules/@my-org/tailwind-config/styles.css
, but fromnode_modules/.pnpm/@my-org+tailwind-config@1.0.0/node_modules/@my-org/tailwind-config/styles.css
.@source
needs to be../../../../../@my-org/button/dist
which is not very reliable.I think re-opening this PR (#16425) could fix this issue, maybe making the default be the FileSystem one and optionally the Module Graph system.
The text was updated successfully, but these errors were encountered: