Has anyone else had issues with corrupted woff or woff2 files uploaded through the assets folder?

I’ve done this plenty of times in the past: upload a font file to assets, link to it with @font-face in either the css file or in the theme.liquid head inside tags.

For some reason, I’m getting these warnings in the console:

Failed to decode downloaded font: {{ font url }}

and then
OTS parsing error: Failed to convert WOFF 2.0 font to SFNT

I originally thought we, bugger, font files screwed, lets get another one. So apparently we can’t upload ttf files to assets anymore? Okay, so then I went and found a random woff that I knew WAS working from assets folder, uploaded it, same warnings.

I thought this ain’t right, used the fonts an a completely external site, both work fine. Rightio. So next I tried to upload the font through Settings > files, and low and behold it works fine!

Only problem is, client had a trial site and they don’t allow woff files for trials! FFFFFFFS

Anyone know if this is a known issue, any other "workarounds I haven’t thought of?

6 Likes

Same here! Asset uploads = corrupted. Crazy town.

3 Likes

Yes, fonts seem to get corrupted in the assets folder. Had to move them to the files upload area and access with file_url instead of asset_url to fix the problem.

5 Likes

Recently having issues on using custom fonts uploaded on Shopify theme assets folder. When a font is connected & used on theme from the theme asset folder via @font-face , it faces issues on loading properly, although the exact same font is being used on older uploaded themes.

Error notices on console:

“Failed to decode downloaded font: ”

“OTS parsing error: Failed to convert WOFF 2.0 font to SFNT”

“OTS parsing error: incorrect file size in WOFF header”

At first I thought the font got corrupted somehow. So repackaged the font correctly (though it wasn’t corrupted, but still tried to be safe) & then re-uploaded on the theme asset folder. But still the error persists. Also tried other possible solutions. But none works when the font is uploaded & used from theme asset folder.

If anyone is facing the same & found a workaround please, let me know. Or share your experience, so that we can understand what is happening!

Appreciate the help.

2 Likes

Upload it to the site files and use that link instead

2 Likes

Just in case anyone else stumbles upon this thread, uploading to the files section solved this for me. It is still an issue in february 2023.

6 Likes

Spent hours trying to figure out what is the problem. It is still there as of January 2024. Moving fonts to Files helped.

1 Like

How do you upload it to the site files? I’m a Shopify Newbie and within the edit code section there’s no obvious way to get to the file structure beyond the folders they’re showing you.

Never mind, I found it :slightly_smiling_face: Feel silly now.

files like a picture for those who wonders, then you need to change a bit your code: it works actually. Shopify su**s once again.

AXPn_0-1716992426733.png