nuxt / fonts

Plug-and-play web font optimization and configuration for Nuxt apps.

Home Page:https://fonts.nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Tuples must be sorted" error with google fonts provider and multiple font weights

qwerzl opened this issue · comments

I'm encounting an error when using google fonts provider and multiple font weights. Nuxt reports a 400 bad request error. Looks like Google enforces a sorted tuple for requests.

Request link: https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;1,100;0,200;1,200;0,300;1,300;0,400;1,400;0,500;1,500;0,600;1,600;0,700;1,700

Error from Google:

400: Invalid selector
Tuples must be sorted
IBM Plex Mono:ital,wght@0,100;1,100;0,200;1,200;0,300;1,300;0,400;1,400;0,500;1,500;0,600;1,600;0,700;1,700

My config:

fonts: {
  families: [
    { name: 'IBM Plex Mono', provider: 'google' },
  ],
  defaults: {
    weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],
    styles: ['normal', 'italic'],
    subsets: [
      'latin-ext',
      'latin',
    ],
  },
  assets: {
    prefix: '/_fonts',
  },
},