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

Incompatibility with newer versions of sprockets-rails #1013

Closed
brian-kephart opened this issue Dec 13, 2021 · 2 comments
Closed

Incompatibility with newer versions of sprockets-rails #1013

brian-kephart opened this issue Dec 13, 2021 · 2 comments

Comments

@brian-kephart
Copy link
Collaborator

When upgrading from sprockets-rails 3.2.2 to 3.4.1 or 3.4.2, font awesome font urls are incorrectly fetched in production. Unfortunately I haven't been able to reproduce in development.

To reproduce, install an affected version of sprockets, start a production server and visit the admin panel. Icons in the sidebar will not render. In the devtools network panel, font awesome urls will show 404. Click on one, and you should see:

  • Expected
    • my-host/font-awesome-url.woff2
  • Actual
    • my-host/my-host/font-awesome-url.woff2

@texpert you did some work on non-digest assets, would you be able to take a look at this as well? I have a feeling you might be able to figure this out faster than me 😃

Known affected versions of sprockets-rails:

  • 3.4.1
  • 3.4.2

Known unaffected versions of sprockets-rails:

  • 3.2.2 and below
@texpert
Copy link
Collaborator

texpert commented Dec 13, 2021

@brian-kephart , I am on Ruby 2.7.5 and Rails 6.1.4.1 and have no such problems with sprockets-rails 3.4.2 - are you talking maybe of Rails 7.0-alpha?

sprockets-rails has introduced the resolve_assets_in_css_urls=false option to opt out of adding the digest to CSS filenames so we could possibly remove the 'non-digest-assets'. gem. But I am not at all certain if it is a good thing, turning off the assets digesting globally.

@brian-kephart
Copy link
Collaborator Author

Thanks @texpert for looking at this. I tried version 3.4.2 again while also expiring my assets and all seems to be well with that small change. 3.4.2 must have been caching the bad urls that were built with the problematic version 3.4.1. I would have chased that around all day if you hadn't responded that it worked in your case.

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

2 participants