Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Fonts won't load on localhost

Why aren't fonts loading on my localhost with Shopify CLI version: 3.49.1?

manuelhpineda
Shopify Partner
2 0 0

I am on Shopify CLI version: 3.49.1
I am unable to load fonts selected on the theme settings because they are routing to the local host instead of the Shopify cdn is there a way of changing this or fixing it? It is super annoying as I cannot see the correct style of my page while development and I have to rely on refreshing the theme customization page.. It works perfectly on the server or deployed themes.

http://127.0.0.1:9292/cdn/fonts/futura/futura_n5.5632c6d8a6da9141ef40e51d14264a007bcae7e5.woff2?h1=Y...0aC5jb20&h2=YmVhdXR5LWJ5LWVhcnRoLW5hdHVyYWwtYmVhdXR5LmFjY291bnQubXlzaG9waWZ5LmNvbQ&h3=YWNjb3VudC5iZWF1dHlieWVhcnRoLmNvbQ&hmac=d16f5b5ced5dd590acbd9d05a826dfd9994fd9fbfcef4fe6b3c9ba8db41c08c2

 

Screenshot 2023-09-06 122106.png

Screenshot 2023-09-06 122059.png

  

 

Replies 4 (4)

matedemorphy
Shopify Partner
1 0 1

same problem

manuelhpineda
Shopify Partner
2 0 0

found any solution yet?

vaishnavi_s0129
Shopify Partner
6 0 0

me too facing the same issue

mtc_dev
Shopify Partner
6 2 7

Adding json filter worked for me. Somehow, it changes localhost address to the live one

@font-face {
font-display: swap;
font-family: 'Some font';
font-style: normal;
font-weight: 400;
src: url({{- 'some-font-file.woff2' | asset_url | json -}}) format('woff2');
}