Skip to content

[Bug]: Console Warning : Resource was preloaded but not used within a few seconds #69

@1Luc1

Description

@1Luc1

Demo URL

No response

What happened?

I set up a FontSource like described within the ReadMe. In particularly I used the variable fontsource "@fontsource-variable/source-serif-4": "^5.0.19"

This Warning shows only if the app is build. Within development this warning does not appear.

I don't know if this is related to #64 or not; this is why I upvoted/promoted that issue.

vue v3.4.27
vite v5.2.11
unplugin-fonts v1.1.1

Reproduction steps

  1. install unplugin-fonts v1.1.1
  2. install fontsource (e.g. @fontsource-variable/source-serif-4)
  3. setup unplugin-fonts to use fontsource within vite.config.mjs
    Unfonts({
      fontsource: {
        families: ["Source Serif 4 Variable"],
      },
    }),
  1. import unfonts style within main.js import "unfonts.css";

  2. use font somewhere within app

   html {
    font-family: "Source Serif 4 Variable", sans-serif;
  }

Relevant log output

The resource [URL *.eot, *.woff2, *.woff, *.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.

What browsers are you seeing the problem on?

Firefox, Microsoft Edge, Other

What is your operating system?

Windows, Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions