Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
Vue 3 Vite load fonts from assets with Font Loading API results in 404

I am trying to dynamically load fonts from the assets directory in Vue 3 (Typescript) using Vite. But the whole thing results in a 404 error.

enter image description here

const fonts = import.meta.glob('@/assets/fonts/*.otf')

console.log(fonts)

async function loadFonts() {
  for (const path in fonts) {
    const fontName = path.split('/')[3].split('-')[0]

    console.log(fontName)

    const myFont = new FontFace(fontName, `url('${path}')`)
    await myFont.load()
    document.fonts.add(myFont)

    console.log(myFont)
  }
}

loadFonts()

enter image description here

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!