-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
tailwindcss v3.0.5 is not picking up changes unless I change tailwind.config.js file #6553
Comments
@giky I am having the exact same issue with a fresh install using Following the "Installation" section in the tailwindcss docs to the letter, when saving my *.html file I get the "Rebuilding..." line in the terminal, but the resulting *.css file does not include the changes that I've made. I've noticed that sometimes when giving focus back to my terminal window, the "Rebuilding" line comes up again and it will actually generate the correct output... so I am really unsure what is going on here. I didn't have these issues in the 2.x branch from memory. I attempted to roll back to 3.0.0 and I am having the same results. This is on a fresh install of Alpine (3.15) in a VM, running |
@giky Can you please provide a reproduction? Not easy to help if we can’t clone a repository down that demonstrates the issue. Last I checked vue-cli was using PostCSS 7 internally which would explain a lot of incompatibilities with Tailwind, since we rely on PostCSS 8 and the latest version of postcss-loader. |
|
Facing the same issue :) |
@nfuad are you using tailwindcss + vue like the OP, or just a plain tailwindcss v3 install like myself? @adamwathan any luck looking into this one by chance? I'm still having zero success with a complete vanilla install (literally just npm + tailwindcss on a fresh VM and following the guide in the install documentation). Hoping I can figure this out, I really want to start using v3. |
I'm having the same issue. I am using the Tailwind CLI instructions provided on https://tailwindcss.com/docs/installation and the installation goes smoothly. However, when starting the Tailwind CLI build process with |
similar issue for me using Vue 3 + Vite. in the above code, the |
@DistantMe, no I have a next.js 12.0.6 + tailwind setup. |
You can't use dynamic class with concatenation like that. https://tailwindcss.com/docs/content-configuration#class-detection-in-depth |
Same issue for me as well. Either gotta restart vite or changing tailwind.config.js to see updated classes. |
@adamwathan Just an update, I've gone ahead and tested the standalone binary ( Can't seem to get the Linux x64 binary to work under Alpine though, guessing it's not built for use against musl? If I could get the standalone working in Alpine, that would be a decent solution for me. edit: installing |
Not gonna work even on 3.0.0, just checked it out, installed as a postcss plugin in nx workspace with angular preset Upd: it works watching a single file, but with glob pattern like |
I was also able to get it working by setting the
|
Can confirm a similar behavior in which when recompiling (using webpack hot reload) the styles are not regenerated unless I re start my local server. I'm on Tailwind 3.0.7 on a React project. This is a pseudo repro step list to help understand the issue:
Edit: I had to update all dependencies related to style loader in webpack and now is working as expected. |
Having the same problem with dynamicly build css classes in my vuejs project i have found you can just safelist classes. Thanks @christhofer of pointing this out. Part of my code, where you can pass any color as prop:
|
@giky Thanks for the reproduction! In this case the issue seems to be that vue-cli is using very old versions of some dependencies which don't support the features necessary for the JIT engine to work. Specifically it is using So I'm afraid vue-cli just currently doesn't support Tailwind 3, and vue-cli itself needs to be updated for it to work. In these cases we recommend using Tailwind CLI to compile your CSS on the side if you can't migrate to an up to date tool: https://tailwindcss.com/docs/content-configuration#it-just-isn-t-working-properly There are lots of other folks replying here about similar problems but not the same problem (that vue-cli doesn't work with Tailwind 3). I'm closing this particular issues since we've gotten to the bottom of it, and it's not a good idea for us to try and track multiple different possible issues under the same issue. If you are having a problem, please create a new issue including a reproduction and we will do our best to take a look. Most situations similar to this one will definitely be caused by projects using outdated dependencies, so the answer will likely be the same. Not trying to be dismissive or ignore anyone's issues, it's just not possible to keep track of things unless every separate problem has a separate issue. Some people have mentioned issues with Vite — Vite should work perfectly generally, but there is a known issue with using Vite + the community-maintained Vue 2 plugin: This will require a fix in that plugin for things to work as expected. The |
|
thank you for your kind and informative response. I appreciate you! <3 |
I am also running into this issue where it doesn't seem to be picking up on new classes used, so I need to completely restart my build. Tried updating to the latest tailwind to see if that helped but still repro'ed. Seems to be something with the glob patterns. One thing I found that worked as a temporary workaround was to add whatever file I'm working on at the moment explicitly to the |
Hate to say it, but I switched over to using windicss for now, no issues so far + added features/benefits. |
I am facing same issue with SvelteKit as well. Tailwind doesn't regenerate classes unless I change the config.cjs file or restart the server. |
@saym97 Can you open a new issue with a reproduction? It would really help! |
Here it is , I have created the new issue and explained the problem according to my understanding, Thank very much for replying. |
Adding to this i can confirm. |
Leaving this here in case it'll help someone, I'm on a Mac and had a similar issue of changes not being picked up when using glob patterns: Updating my postcss-cli from v8 to |
I ran into the same issue after installing vite-plugin-handlebars, disabling the auto reload of that plugin fixed the problem for me: https://github.com/alexlafroscia/vite-plugin-handlebars#disabling-browser-refresh-on-partial-change |
Same issue here when using ViewEncapsulation.ShadowDom for an Angular Elements webcomponent. glob = require("glob");
module.exports = {
content: glob.sync("./src/**/*.{html,ts}"),
...
} |
I ended up using |
Modifying ESBuild solved the problem for me (16.1.6) |
What version of Tailwind CSS are you using?
v3.0.5
What build tool (or framework if it abstracts the build tool) are you using?
"postcss": "^8.4.5"
What version of Node.js are you using?
v16.6.2
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
Describe your issue
Sometimes tailwind is not adding classes to final CSS when I'm adding them to my HTML files unless I edit the
tailwind.config.js
file, I usually comment and uncomment some line in that file and all of sudden I see the class has been added to the CSS file, I had this very same issue on my Next.js project as well.I made a new reproduction repository and tested things there, it was all good and working. Not really sure why it's not working on my own projects at some point. This may sound stupid but maybe tailwind is not picking up changes as the project get's more complicated?
I made this issue to know if anyone had some similar experience or not, so maybe someone can guide me on how to resolve this.
But if I change to the old version tailwindcss 2.2.19, there will be no problem
The text was updated successfully, but these errors were encountered: