ERR_ABORTED while loading Azure apps with custom font files

We have deployed a SharePoint provider hosted app in Azure App Services. The app was using few custom fonts & the font files (.woff extension) were referred in the app. While loading the app page, everything worked well but the fonts weren’t rendered properly. While investigating through developer tools, there were ERR_ABORTED error thrown for all the font files loaded.

Cause & Solution:

When you publish files in Azure, not all file types will be served by default. We may need to specify the file types we need to use explicitly. These are referred as MIME types. A MIME type is a two-part identifier for file formats & it consists of a type, a sub-type and optional parameters. Unless specified explicitly the files will not be served. In few cases you may also get the error. The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
So in our case, we were using .woff files for the font. So we added below code snippet in the web.config file of the Web App which solved the issue.
<system.webServer> <staticContent> <mimeMap fileExtension="woff" mimeType="application/font-woff" /> </staticContent> </system.webServer>
Hope you found this article useful. You could also find lot more solutions hereĀ
Do let us know if you liked this article and voice out your comments below.
Sharing is Caring!

Leave a Reply

Your email address will not be published. Required fields are marked *