Skip to content

[BUG]: Font does not load in dev on Windows #641

Open
@TheDogHusky

Description

@TheDogHusky

Hey!

Built an application with nuxt originally on my linux machine. I cloned the repo and started developing again on my Windows machine, but came to an issue:
I load the Source Code Pro font through nuxt fonts with the google provider:

import pkg from './package.json';

export default defineNuxtConfig({
    compatibilityDate: '2025-05-15',
    devtools: { enabled: false },
    srcDir: "src",
    css: [
        '~/assets/css/main.css',
        '~/assets/css/nerdfonts.css'
    ],
    modules: ['@vueuse/nuxt', '@pinia/nuxt', 'pinia-plugin-persistedstate/nuxt', '@nuxt/fonts'],
    fonts: {
        families: [
            { name: 'Source Code Pro', provider: 'google', subsets: ['latin'] },
        ]
    },
    runtimeConfig: {
        public: {
            version: pkg.version
        }
    }
});

However, on windows, somehow, no errors pops up, just the font doesn't exist in the CSS, I can't use it:
It defaults to the default browser font when I only specify "Source Code Pro" as family to force it into trying to use it (see screenshots)

As I previously said: no errors in the console (browser) and terminal.
The nuxt-fonts-global.css file that is being loaded into my page is a sourceMap:

<style type="text/css" data-vite-dev-id="virtual:nuxt:D%3A%2FUtilisateurs%2FAdam%2FDocuments%2Fdev%2FTypeScript%2Fsites%2Fhome-clock%2F.nuxt%2Fnuxt-fonts-global.css">
/*# sourceMappingURL=data:application/json;base64,eyJmaWxlIjoidmlydHVhbDpudXh0OkQlM0ElMkZVdGlsaXNhdGV1cnMlMkZBZGFtJTJGRG9jdW1lbnRzJTJGZGV2JTJGVHlwZVNjcmlwdCUyRnNpdGVzJTJGaG9tZS1jbG9jayUyRi5udXh0JTJGbnV4dC1mb250cy1nbG9iYWwuY3NzIiwibWFwcGluZ3MiOiIiLCJuYW1lcyI6W10sInNvdXJjZXMiOltdLCJ2ZXJzaW9uIjozfQ== */</style>

I have no idea if this is intended
I don't know how it looks like on linux, as I haven't tested.
To clarify, I used an Arch Linux machine.

Here are my versions on my current host:
Windows 11
Node 22.14.0
Yarn 1.22.22
Nuxt 3.17.4
Nuxt fonts 0.14.4

Any ideas?
Here is the repo if you want to try that for yourself: https://github.com/TheDogHusky/home-clock

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions