-
Hello. I followed the documentation for Symfony's app to install tailwindcss 4.1 in my Symfony project. Compilation goes smoothly with Webpack Encore and my page displays well. But I notice in my console that Webpack continues to compile ad infinitum. Has anyone had this problem before? Tailwindcss version : "^4.1.3" |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey! Can you share a minimal reproduction repo so we can take a look at what's going on? My guess is that you are writing files into a folder that happens to be scanned again and therefore an infinite loop happens. If you can identify the folder you are writing files into, you could mark that folder explicitly using But if the folder makes sense to be ignored by default, then I would love to hear about it! |
Beta Was this translation helpful? Give feedback.
-
Hi, After some digging, I found the problem came from Tailwind CSS’s new automatic content detection. It scans all files — including those in the public/ directory, which contains compiled assets — causing an infinite loop. ✅ Solution: In your main CSS file (e.g., app.css), add this line to exclude the public/ directory from scanning:
Adjust the path depending on where your CSS file is located. Since Tailwind v4, you can define sources directly in your CSS using @source, and exclude folders using @source not. |
Beta Was this translation helpful? Give feedback.
-
Excluding the public from css file did not work for me. Leaving this here in case it can help someone. |
Beta Was this translation helpful? Give feedback.
Hi,
I had the same issue with Tailwind CSS 4.1 in a Symfony project: Webpack Encore was endlessly recompiling files.
After some digging, I found the problem came from Tailwind CSS’s new automatic content detection. It scans all files — including those in the public/ directory, which contains compiled assets — causing an infinite loop.
✅ Solution:
In your main CSS file (e.g., app.css), add this line to exclude the public/ directory from scanning:
@source not "../../public/*";
Adjust the path depending on where your CSS file is located.
Since Tailwind v4, you can define sources directly in your CSS using @source, and exclude folders using @source not.