Tailwind live rebuild doesn't work on new application when modifying a view #522
-
Hello, team, I’m experiencing an issue with live rebuild not functioning correctly in a new Rails application when modifying a view. Here's how to replicate the issue: Steps to reproduce:
Additional information:
I would appreciate any suggestions or workarounds for this issue. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 2 replies
-
Hi @sarrietav-dev, does your
if there are no errors, of course. The first line indicates which version of tailwindcss you're running (I'm asuming latest, but can you clarify?), and the second one that it built the output file. Then, every time you change a source file, you should be seeing a Could you indicate which versions of rails and tailwindcss-rails are you using? Also can you tell if that process is running without errors?
Regarding this, this gem doesn't provide live-reloading of your browser. If that's what you're after, you should be looking at hotwired/spark. |
Beta Was this translation helpful? Give feedback.
-
Hello @patriciomacadden I'm using the latest version of Yes, the
And I only get this line just once on the logs:
I also tried to use I think the issue is that the tailwind process only builds the output stylesheet once but doesn't watch for new changes. |
Beta Was this translation helpful? Give feedback.
-
@sarrietav-dev We need more information in order to be able to diagnose what you're seeing. I cannot reproduce what you're describing, following the steps you have run above. In particular, I see the following lines emitted by the
Then, when I refresh the web page in the browser, I see the updated style. It's all working for me. What are you seeing emitted from the What's your setup? I'm running on a Linux x86_64 machine, I'm not using docker, and I'm using tailwindcss-rails 4.2.1 and tailwindcss-ruby 4.0.16. In particular, are you running in a Docker container or running on Windows with WSL? |
Beta Was this translation helpful? Give feedback.
-
@flavorjones I'm using a Linux x86_64 laptop running Ubuntu 24.04. My Gemfile.lock says that I'm using tailwindcss-rails 4.2.1 and tailwindcss-ruby 4.0.16. I'm using ruby 3.3.5 through rbenv 1.3.2 and node 22.14.0. No Docker. Below there's the code that I used and a video of the issue. sarrietav-dev/tw-rails-issue-rep Screencast.From.2025-03-25.17-38-07.webm |
Beta Was this translation helpful? Give feedback.
-
Hi @flavorjones @patriciomacadden, I tested the code on a Github Codespace and it worked as intended. I guess the issue is my machine. |
Beta Was this translation helpful? Give feedback.
-
@sarrietav-dev Thanks for letting us know. I poked around in the upstream issues and learned that the tailwind CLI uses https://github.com/parcel-bundler/watcher for watching for file changes. Perhaps there's something mentioned in that project's code or docs that might help you? In them meantime, since I don't believe there's anything we can easily do in this project, or in tailwindcss-ruby, to help, I'm going to convert this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
@sarrietav-dev Is there any chance you have watchman installed on the system that isn't watching correctly? I found this issue upstream: tailwindlabs/tailwindcss#17246 and I was able to reproduce what you're reporting simply by installing watchman on my system (and can fix it by removing watchman). If your problem goes away when you remove watchman, it would be great if you could comment on that issue! |
Beta Was this translation helpful? Give feedback.
@sarrietav-dev Is there any chance you have watchman installed on the system that isn't watching correctly? I found this issue upstream:
tailwindlabs/tailwindcss#17246
and I was able to reproduce what you're reporting simply by installing watchman on my system (and can fix it by removing watchman).
If your problem goes away when you remove watchman, it would be great if you could comment on that issue!