Subscribe on changes!

Build 404 when importing fonts from public/ with import.meta.glob

avatar
Jul 17th 2022

Vue version

3.2.37

Link to minimal reproduction

https://github.com/Backifyco/backify-font-logo-finder

Steps to reproduce

The import of the fonts: https://github.com/Backifyco/backify-font-logo-finder/blob/master/src/App.vue#L15

The font alias is set here: https://github.com/Backifyco/backify-font-logo-finder/blob/master/vite.config.ts#L12

The base property in vite.config.ts is for github-pages and was not used in the live version.

What is expected?

That the fonts are found.

What is actually happening?

Network: image

Generated code: image

Dist: image image image

It is also very strange that the fonts exist several times, once in assets/ and once in fonts/.

System Info

System:                                                        
    OS: Windows 10 10.0.19044
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 17.96 GB / 31.95 GB
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.62)    
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.2.37 => 3.2.37

Any additional comments?

No response

avatar
Jul 17th 2022

Seems to be a vite or create-vue issue.

avatar
Jul 17th 2022

If anyone has a similar problem and would like to follow up then track it here: https://github.com/vitejs/vite/issues/9169