#Fix preload font errors

1 messages · Page 1 of 1 (latest)

spark hazel
#

After a form submission using a Svelte component inside an Astro page, I'm getting a bunch of preloaded font errors logged to the console:

The resource https://mysite/fonts/Poppins.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.

How can I fix this?

#

I think this also happens when I used prefetch too.

#

The bundled code looks correct:

<link rel="preload" href="/fonts/Poppins.woff2" as="font" type="font/woff2" crossorigin>
#

The font is served from the public directory so none of these files are hashed.