-
Notifications
You must be signed in to change notification settings - Fork 247
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
Double inclusion of config.asset_host in CSS url()
used with .erb asset path helpers
#488
Comments
Verified problem still reproduces (problem is still there) on sprockets-rails main branch at 4e0f168 |
(Sorry, I keep making comments and then deleting them about whether different forms of absolute/relative url in |
OK, now I think maybe the problem IS fixed at main branch at 4e0f168. Could someone else verify this though? I don't trust myself, I keep seeing different things! If it is fixed on main, could we get a patch release soon, to spare others this trouble? |
I ran into this as well, and can confirm it is fixed in 3.4.2. FWIW, for some reason I had to bump my |
Confirmed fixed for me too in 3.4.2, with I think the second one (hostname-only) triggered bug previously as well, and is recommended in some Rails docs. Both seem fixed to me in 3.4.2. |
I believe this began with release 3.3.0, and is a regression caused by #476
Let's say we have an
application.css.erb
with this in it:And we have
config.asset_host = '//example.org'
. (The//
protocol-agnostic asset_host is a common setting for CDNs, often recommended in docs).With sprockets-rails 3.3.0+, if you
./bin/rails assets:precompile
, the output at./public/assets/application-[fingerprint].css
looks like:Note that
//example.com/example.com
is there twice. This reproduces with sprockets rails 3.3.0 and 3.4.1. (both with sprockets 4.0.2).If you downgrade to sprockets 3.2.2, the output is as expected:
I believe this is a regression beginning with sprockets-rails 3.3.0.
I actually ran into this using font-awesome-rails on an app that deploys to heroku, with a CDN
config.asset_host
. font-awesome-rails uses thefont_path
helper in a.css.erb
here. While that font-awesome-rails gem may be no longer supported, we ought not to get a regression in a minor sprockets-rails release. But also, I then isolated the reproduction as above, which also seems to be a general problem. It may be possible to isolate/generalize further, may also occur with sass-rails helpers not just the erb ones? May occur with other helpers, not justfont_path
?The text was updated successfully, but these errors were encountered: