-
Notifications
You must be signed in to change notification settings - Fork 147
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
Not reloading CSS correctly with config.assets.debug = false #169
Comments
We have guard-livereload and Maybe it's a |
I have the same issue with liveguard and Rails 5.0.0.1 with @humphreybc Were you able to fix it? |
Meet the same problem with Rails Solved it by adding Not sure what exactly caused the problem. My guess is that Rails 5 won't respond to asset request with incorrect digest any more (livereload resend asset request with query string |
Thanks a lot @bianjp it solved the problem to me too. You think it could be something with sprockets? Could you please explain what exactly disabling digest does? Here is not very clear. We have in
|
Assets urls in Rails are like the following:
Note that assets urls in Rails 4.2 contain query string '?body=1'. Look at the following code in sprockets 3.7.1 (I marked the line number in comments):
So the following behaviors together lead to the failure of css live updating if assets digest is enabled:
Disabling assets digest bypasses the digest validation, so it works. |
I can confirm that @bianjp's analysis still holds on Rails version
I guess this is a fine workaround for a development environment. Reference: https://guides.rubyonrails.org/asset_pipeline.html |
@potentialize Thank you! This worked for me with Rails 6! |
Also had to set this in
This is not ideal, because without the digest assets like js are then sometimes not up-to-date and need an explicit browser refresh. |
In my development environment I've set
config.assets.debug
tofalse
to speed up page load times when developing locally otherwise they can take a few seconds. However that seems to have broken guard-livereload reloading CSS. When I make changes, the page breaks and I get a 404:My app/assets/stylesheets folder is a pretty standard Rails structure with an
application.css.scss
file that imports all the other smaller CSS files in the same folder.My Guardfile is standard. I have
Ruby 2.3.1p112
andRails 5.0.0.1
. Is guard-livereload not compatible with this option? Thanks for the help.The text was updated successfully, but these errors were encountered: