nuxt / fonts

Plug-and-play web font optimization and configuration for Nuxt apps.
https://nuxt.com
MIT License
369 stars 4 forks source link

This font won't work on production: DM Serif Display #122

Closed fayazara closed 1 month ago

fayazara commented 1 month ago

Thought this issue was related to my project, but I was able to reproduce it, sounds weird but this font won't work on a production build - https://fonts.google.com/specimen/DM+Serif+Display

I am using the font by mentioning it in my tailwind config

import type { Config } from "tailwindcss";

export default <Partial<Config>>{
  theme: {
    fontFamily: {
      sans: [
        "DM Sans",
        "Avenir Next",
        "Roboto",
        "-apple-system",
        "BlinkMacSystemFont",
        '"Segoe UI"',
        "Ubuntu",
        '"Helvetica Neue"',
        "Arial",
        '"Noto Sans"',
        "sans-serif",
        '"Apple Color Emoji"',
        '"Segoe UI Emoji"',
        '"Segoe UI Symbol"',
        '"Noto Color Emoji"',
      ],
      mono: [
        "Cascadia Code",
        "ui-monospace",
        "SFMono-Regular",
        "Menlo",
        "Monaco",
        "Consolas",
        "Liberation Mono",
        "Courier New",
        "monospace",
      ],
      display: ["DM Serif Display", "Inter", "sans-serif"],
    },
  },
  plugins: [require("@tailwindcss/typography")],
};

The first font DM Sans is loads correctly, but the display font wont, throws a 404 in production.

Here's a reproduction - https://github.com/fayazara/nuxt-font-repro

Dev environment screenshot Screenshot 15-04 at 19

Production screenshot Screenshot 15-04 at 19

fayazara commented 2 weeks ago

@danielroe Can we use this module as edge version (latest commit) till a new release it cut.

danielroe commented 2 weeks ago

I'll release ❤️