tailwindcss: CLI Watch never end 2 CPU cores at 100%
What version of Tailwind CSS are you using?
v4.0.14
What version of Node.js are you using?
v20.18.0
What operating system are you using?
Windows 11
Reproduction URL
I just use the Tailwind4 directory of https://github.com/pinzonjulian/tailwind_css_cli_watch_bug.git
git clone https://github.com/pinzonjulian/tailwind_css_cli_watch_bug.git
cd tailwind4
npm install tailwindcss @tailwindcss/cli
npx @tailwindcss/cli -i input.css -o output.css --watch
Describe your issue
Command never end, there is no output, 2 cores at 100%.
If I remove output.css, the process don’t create it.
When I remove --watch. It works :
> $env:DEBUG=1; npx @tailwindcss/cli -i input.css -o output.css
≈ tailwindcss v4.0.14
Done in 91ms
[95.04ms] [@tailwindcss/cli] (initial build)
[14.09ms] ↳ Setup compiler
[38.04ms] ↳ Scan for candidates
[33.33ms] ↳ Build CSS
[ 1.06ms] ↳ Write output
Could a global configuration be the cause of the problem?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 26 (10 by maintainers)
It doesn’t seem to make a difference for me. It takes about 1m32s with or without the ignore parameter.
I tried starting the rails app in my repro Linux VM but even though my
tmpdir looks the same, it doesn’t take that long to start. That said I’m on a Hetzner VPS where they do claim that they use NVMe drives so that might explain why it’s fast for me. 🤔So I naturally duplicated the
tmp/folder a dozen times and now it’s getting slower (4sec already!). This does indeed seem like the issue is related to #15750.Now let me try if that ignore setup would work.
I can reproduce what seems to be this issue when I have watchman installed; and it goes away when I uninstall watchman.
With watchman installed, on a Linux x86_64 GNU libc system (native, not in a container) running with
DEBUG=1, I see:The initial startup takes 81 seconds. After that startup, everything seems responsive and changes to files result in:
Without watchman installed, though, startup is 1000x faster:
@lenart The issue you’re running into might be https://github.com/tailwindlabs/tailwindcss/issues/17379 and is unrelated to watch mode. Do you mind taking a look there and, if possible, can provide us with a reproduction of that issue? Thanks!