Skip to content
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

Dev Server/Tailwind Watch Mode Not Refreshing #119

Closed
richjdsmith opened this issue Jan 2, 2022 · 6 comments
Closed

Dev Server/Tailwind Watch Mode Not Refreshing #119

richjdsmith opened this issue Jan 2, 2022 · 6 comments

Comments

@richjdsmith
Copy link

I can't replicate this so I'm going to create this issue then close it in hopes it helps some other poor bugger googling the issue. When I was running my rails server (locally only) and running Tailwind in watch mode, I had a funny issue where Tailwind was producing a new version of application.css but my rails server was not using the new version.

If I restarted the rails server, it had no effect. If I ran rails assets:precompile', it would produce a new version of the tree-shaken applicaiton.css` but the dev server would not use it. I could not use new tailwind classes in my code.

The solution: rails assets:clobber

That sorted it out and got my server acting as expected. I have no idea why. This was running on a project that was a couple hours hold running Rails 7.0, Ruby 3.0.3 and using the tailwindcss-rails gem for Tailwind.

I have tried to replicate this but have not been able to. Hoping at least this will help someone else from a couple of hours tearing out their hair.

@viktorshamal
Copy link

Thank you for saving me from tearing out my hair ❤️

@multiplegeorges
Copy link

@richjdsmith Saved me too, thanks!

@dhh
Copy link
Member

dhh commented Apr 30, 2022

Sounds like you had precompiled locally. Precompiled files take precedence over dynamic files with Sprockets.

benkoshy added a commit to benkoshy/cssbundling-rails that referenced this issue Dec 20, 2022
### What is this PR?

Adds a trouble-shooting solution - sprockets wasn't serving an updated css file. Why not? 

After many hours of hair-pulling, I stumbled upon this issue: rails/tailwindcss-rails#119 which saved the day.

It's easy to overlook, and probably warrants a note in the documentation.

Hence this PR. Hopefully, it will save someone a lotta of trouble.
dhh pushed a commit to rails/cssbundling-rails that referenced this issue Dec 21, 2022
### What is this PR?

Adds a trouble-shooting solution - sprockets wasn't serving an updated css file. Why not? 

After many hours of hair-pulling, I stumbled upon this issue: rails/tailwindcss-rails#119 which saved the day.

It's easy to overlook, and probably warrants a note in the documentation.

Hence this PR. Hopefully, it will save someone a lotta of trouble.
@fabioacd
Copy link

fabioacd commented Jan 3, 2023

Thank you!! I was going crazy with this error.

rails tailwindcss:watch was working just fine and it went down when I installed the gem 'rails_live_reload'. In my case that could be the cause of the error.

Thanks again

@alanenglish
Copy link

alanenglish commented Feb 23, 2023

@richjdsmith so rails tailwindcss:watch does not provide live reloading after updates - correct?

does anyone have a specific gem they recommend for live reloading that is well maintained?

@fabioacd is everything working well for you with rails-live-reload now?

smartech7 pushed a commit to smartech7/ruby-css-bundling that referenced this issue Aug 4, 2023
### What is this PR?

Adds a trouble-shooting solution - sprockets wasn't serving an updated css file. Why not? 

After many hours of hair-pulling, I stumbled upon this issue: rails/tailwindcss-rails#119 which saved the day.

It's easy to overlook, and probably warrants a note in the documentation.

Hence this PR. Hopefully, it will save someone a lotta of trouble.
@fh0enix
Copy link

fh0enix commented Oct 27, 2023

Thank you! That is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants