Skip to content

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

@jannikbuscha

Description

@jannikbuscha

Describe the bug

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/.

Reproduction

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

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.

System Info

System:                                                        
    OS: Windows 10 10.0.19044                                    
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 20.19 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:
    @vitejs/plugin-vue: ^2.3.3 => 2.3.3
    vite: ^2.9.14 => 2.9.14

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions