I have been trying to preload fonts and no matter how I write it, either Chrome, or Firefox will throw some sort of console error.
Case 1
<link rel="preload" href="/fonts/open-sans-v26-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/RobotoCondensed-Regular.ttf" as="font" type="font/truetype" crossorigin>
Firefox:
Error 1
Preload of /fonts/RobotoCondensed-Regular.ttf was ignored due to unknown “as” or “type” values, or non-matching “media” attribute.
Error 2
The resource at “/fonts/open-sans-v26-latin-regular.woff2” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
The resource at “/fonts/RobotoCondensed-Regular.ttf” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
Chrome:
<link rel=preload> has an unsupported `type` value
The resource /fonts/open-sans-v26-latin-regular.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
Case 2(remove type as recommended on many threads here)
<link rel="preload" href="/fonts/open-sans-v26-latin-regular.woff2" as="font" crossorigin>
<link rel="preload" href="/fonts/RobotoCondensed-Regular.ttf" as="font" crossorigin>
Firefox:
The resource at “/fonts/open-sans-v26-latin-regular.woff2” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
The resource at “/fonts/RobotoCondensed-Regular.ttf” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
Chrome:
The resource /fonts/open-sans-v26-latin-regular.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
The resource /fonts/RobotoCondensed-Regular.ttf was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
How do I make these console errors go away? The fonts are displayed instantly when page loads.