I am doing assets pre-compile, and running the application in production mode. After compilation when I load the my index page I got followings warnings in the chrome consol
I had the same issue and that was because of the git treating these files as text. So while checking out the files in build agents, binary was not maintained.
Add this to your .gitattributes
file and try.
*.eot binary
*.ttf binary
*.woff binary
*.woff2 binary
My issue was that I was declaring two fonts, and scss seems to expect that you declare the name of the font.
after your
@font-face{}
you must declare
$my-font: "OpenSans3.0 or whatever";
and this for each font-face.
:-)
I had a corrupted font, although it appeared to be loading without problem and under Sources in Chrome devtools appeared to display, the byte count wasn't correct, so I downloaded again and it resolved it.
just in case this is relevant for someone. I got the exact same error using ASP.NET and C# in Visual studio. When I started the app from within the visual studio it worked, but I got this issue. In the meantime, it turned out, that the path to my project contained the character "#" (c:\C#\testapplication). This seems to confuse IIS Express (maybe also IIS) and causes this issue. I guess "#" is a reserved character somewhere in ASP.NET or below. Changing the path helped and now it works as expected.
Regards Christof
If running on IIS as the server and .net 4/4.5 it might be missing mime / file extension definitions in Web.config - like this:
<system.webServer>
<staticContent>
<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
</staticContent>
</system.webServer>
I was having the same issue.,
OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
(index):1 Failed to decode downloaded font: http://dev.xyz/themes/custom/xyz_theme/fonts/xyz_rock/rocksansbold/Rock-SansBold.woff2
If you got this error message while trying to commit your font then it is an issue with .gitattributes
"warning: CRLF will be replaced by LF
"
The solution for this is adding whichever font you are getting the issue with in .gitattributes
*.ttf -text diff
*.eot -text diff
*.woff -text diff
*.woff2 -text diff
Then I deleted corrupt font files and reapplied the new font files and is working great.