-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[loader] Failed to decode downloaded font. OTS parsing error: invalid version tag #1468
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
Comments
Have you tried adding |
But the url is |
Thank you. It works when the test is |
Please verify on awesome-fonts .css file if the url path for fonts are ok. It works for me. |
I removed all other config and used this:
I hope this helps someone else too. |
Hello @isramv, on your snippet, I think there is a typo on |
I'm having this same issue, and none of the above seem to work for me. |
@mbifulco any luck? |
Not yet, unfortunately :/ |
@mbifulco if you find anything I'd love to see that as well .. 😞 |
Thanks, @isramv !!! This worked great for me. |
Have the same |
Didn't work neither for woff/woff2 files, but now it's ok. What I did:
I also re-converted my font files using online convertors, and now it works like a charm. |
@LaCroute What is "utils" in your example? |
I'd like to share the solution to my problem that's fairly same as yours for those who google they way out here (like me). Given my folder structure / # root of web server
css/
file-that-import-fonts.css
fonts/
font-file.ext The output css file was trying to import font files at the same folder level of it. So it always hit 404 The following snippet solved: {
test: /\.(otf|eot|svg|ttf|woff|woff2)$/,
loader: 'file-loader',
query: {
outputPath: 'fonts/',
publicPath: '../fonts/' // That's the important part
}
}, Now my font files are properly referenced within my css file. |
@designbyadrian sorry I didn't see I adapted my config from this template. So |
Hi @isramv, thank you ! |
Recently I also had the same problem, the following webpack config script snipped is solved the issue:
The most important thing from the config above is name query parameter for url loader, with my config fonts will be rendered as /, you may prefixed this with, for example, fonts: |
@vchyzhevskyi thanks!! It worked after few hours searching a solution |
@vchyzhevskyi this way you'll encode your fonts in base64 into your css file no ? Could be better to have font files to light the weight of your app.. |
it worked for me after I specify the format like this: @font-face {
font-family: "shop-icons";
src: url(node_modules/mypkg/fonts/shop-icons.svg) format("svg"),
url(node_modules/mypkg/fonts/shop-icons.ttf) format("truetype"),
url(node_modules/mypkg/fonts/shop-icons.eot),
url(node_modules/mypkg/fonts/fonts/shop-icons.woff) format("woff");
} Initially I didn't have format and my style looked like: @font-face {
font-family: "shop-icons";
src: url(node_modules/mypkg/fonts/shop-icons.svg),
url(node_modules/mypkg/fonts/shop-icons.ttf),
url(node_modules/mypkg/fonts/shop-icons.eot),
url(node_modules/mypkg/fonts/fonts/shop-icons.woff);
} |
Has Similar issue, This works for me: |
none of these solutions are working for me. still getting the error :) |
@Pushplaybang have u realized wuts going on ? me either having the same erros and still cant figure it out.. :( Edit : I come up with this. simply removed the loader and it worked. I have to mention, my build is with Vue Cli 3 and applying this configuration on vue.config.js Hope this helps. 🎉 {
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
} |
@kaankucukx - ok, will try that out. thanks. |
This works for me thinks |
This solved the issue, thanks!! |
Strangely, this worked for me. If anyone out there is stuck on this with no hope, give this bizarre solution a try ;) |
my config:
chrome console:
The text was updated successfully, but these errors were encountered: