tailwind watch mode not refreshing files in assets folder
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?
tailwind cli
What version of Node.js are you using?
v23.4.0
What browser are you using?
firefox
What operating system are you using?
linux
Reproduction URL
https://github.com/kuon/bug-tailwind
Describe your issue
The watch does not work for files located in the "assets" folder.
I think this is the same issue.
@kuon Hey! Can you clarify what the issue is that you're seeing? I've been running your repro and it seems like whenever I do make touch, the cli does seem to pick up the change? Is this specific to Linux?
https://github.com/user-attachments/assets/507e3766-b295-4a89-9b9a-3f3f2ab11797
Yes, on Linux the CLI does not pick up the change. I tried on two machines to be sure it wasn't specific to my workstation.
-- Nicolas Goy Developer & Engineer
It seems the reproduction is not 100% of the time. I am trying to find the conditions and I will give you an update.
I updated the repo with some path modifications and now it does it 100% for me.
Seems like it could be related to source(none)? Removing it and rerruning make causes make touch to cause rebuilds. Adding source(none) back in then stops make touch from causing rebuilds.
Yes, but it should at least watch itself (the css file) even with source(none). Also the weird thing is that it is dependent on the folders it is located. As you saw the first time, it had source(none) and was working.
So I think there is some subtle bug somewhere.
Yep! A bug somewhere 🐛 To be clear, I wasn't suggesting that it wasn't a bug. I was merely writing my findings in case it helps identify the root cause.
TAILWIND_MODE=watch npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
The main cause is a subtle bug in Tailwind's file watching logic, especially when source(none) is used and files are in certain folders on Linux. Removing source(none), using TAILWIND_MODE=watch, and ensuring your editor triggers proper file events are the best current workarounds