-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Circular dependency because of index.css #17706
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
@Nefcanto Hey! I'm curious if you have any runtime issues as well or if it's only the warning? The warning itself makes sense— |
@philipp-spiess thank you for answering. The problem is that HMR gets invalidated anytime we save main.jsx, and we see a full reload, diminishing the DX. The flow you mentioned ( |
@Nefcanto I see, does this happens only if you update the
Yeah, I also find this confusing. What we do is use the Vite API |
@philipp-spiess it only happens for |
How about setting up an alias in your Vite config to break the circular dependency? Try modifying your vite.config.js:
and in your main.jsx : replace import "./index.css" by import "@Styles" |
@dvd-b, I tried your approach. But it changed nothing. |
What version of Tailwind CSS are you using?
v4.1.3
What build tool (or framework if it abstracts the build tool) are you using?
Vite 6.2.6
What version of Node.js are you using?
v22.14.0
What browser are you using?
Chrome
What operating system are you using?
Debian GNU/Linux 12 (bookworm)
Reproduction URL
https://github.com/Nefcanto/TailwindCyclic
Describe your issue
When I save my
main.jsx
in my Vite + React + Tailwind project, I see this warning:The
index.css
should not cause cyclic dependency.The text was updated successfully, but these errors were encountered: