nuxt: corrupted and missing assets in built vite app ('Failed to decode downloaded font')
Have same issue
- Operating System:
Darwin - Node Version:
v16.13.2 - Nuxt Version:
3.0.0-27383920.81ee59c - Package Manager:
npm@8.1.2 - Bundler:
Vite - User Config:
- - Runtime Modules:
- - Build Modules:
-
The last release 3.0.0-27383920.81ee59c fixed the problem with images in /assets loaded from css url() now loaded correctly, but remains an issue with fonts loaded from /assets in css @font-face, i attach a screenshot of it: (Failed to decode downloaded font: / Failed to load response data)
Fonts loaded as:
/* assets/css/fonts.css */
@font-face {
font-family: 'Noto-Sans';
src: url('assets/fonts/noto-sans/NotoSans-Regular.ttf') format('truetype');
}
_Originally posted by @arb85 in https://github.com/nuxt/nuxt.js/issues/13250
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 25 (5 by maintainers)

@danielroe that does it! maybe
nuxi upgradeshould clear thatyarn buildis currupting font files.Comparing the hashed asset file with the original. Font file no longer previews / loss of metadata / increased file size.
also no custom
assetDir. i would like to post repros for nuxt issues based on my working repo but still need to check in with management on how much i can share, so i appreciate u @arb85 ❤️@danielroe No custom
assetDirfor me, i’ll post a reproduction shortlyThank You for your time (and for Nuxt!) It’s strange, it happens only with some font and only in build (in dev mode all fonts are displayed correctly) and after the upgrade. I have used the same fonts and they are all displayed correctly with previous releases of Nuxt, maybe it’s a Vite-related issue?
[ No issue with any other types of assets after today release,
3.0.0-27383920.81ee59c, before it also effects some .svg images used as background in css url() ]I’ve done a clear version with:
that works well, so I’m trying to add packages one by one to see when the issue appears… then I’ll post the reproduction