Skip to content

CSS url not respecting config.assets.prefix #207

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

Closed
dvisockas opened this issue Oct 8, 2022 · 2 comments
Closed

CSS url not respecting config.assets.prefix #207

dvisockas opened this issue Oct 8, 2022 · 2 comments

Comments

@dvisockas
Copy link

dvisockas commented Oct 8, 2022

Hi!

If you change config.assets.prefix to anything other than /assets/, the gem will still try to fetch /assets/font-url.woff2. I do believe this is not this-gem-specific issue, but couldn't find a cause, so just leaving this here.

App is using rails 7 with sprockets.

@flavorjones
Copy link
Member

@dvisockas Have you tried regenerating all your assets? I'm able to get this to work properly if I follow these steps:

  1. update my application.rb config setting config.assets.prefix = "/xxxxxx"
  2. bin/rails assets:clobber assets:precompile

What I'm seeing in the resulting filesystem:

$ ack "/xxxxxx"

config/application.rb
21:    config.assets.prefix = "/xxxxxx"

public/xxxxxx/es-module-shims.min-682af50e3c4c79a5e219292af4b250c81804d88d5bcf593f4cc0859dca3500a6.js
3://# sourceMappingURL=/xxxxxx/es-module-shims.js-32db422c5db541b7129a2ce936aed905edc2cd481748f8d67ffe84e28313158a.map

public/xxxxxx/stimulus.min-9de320679eff2f59655933f9f0e257b9868f1e6ded6cae9de7698ac159e29246.js
5://# sourceMappingURL=/xxxxxx/stimulus.min.js-8d1a076cbda7e5ed0992e208db54c62a8de8b1f9694828e1a601fbccd9291649.map

public/xxxxxx/inter-font-a12a4024f674bda97d19bb84b8e1a5afabd897ccd1d757a3157c81179745a83d.css
10:  src: url(/xxxxxx/Inter-italic.extra.var-cc59cf4b324781109d703309fc7d8814b6ba74dd2822a3c029715da8cb98ea57.woff2) format('woff2');
20:  src: url(/xxxxxx/Inter-italic.alternates.var-cc59cf4b324781109d703309fc7d8814b6ba74dd2822a3c029715da8cb98ea57.woff2) format('woff2');
30:  src: url(/xxxxxx/Inter-italic.symbols.var-59f27012284f5e97bbff303eb599ca98f29629a1c0fe7352bcc15b27d1dcd937.woff2) format('woff2');
...

@dvisockas
Copy link
Author

@flavorjones clobber did the job.
Thank you!

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