Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 955 Bytes

google-fonts-missing-subsets.md

File metadata and controls

45 lines (31 loc) · 955 Bytes

Missing specified subset for a @next/font/google font

Why This Error Occurred

Preload is enabled for a font that is missing a specified subset.

Possible Ways to Fix It

Specify which subsets to preload for that font.
  • On a font per font basis by adding it to the function call
const inter = Inter({ subsets: ['latin'] })
  • Globally for all your fonts
// next.config.js
module.exports = {
  experimental: {
    fontLoaders: [
      { loader: '@next/font/google', options: { subsets: ['latin'] } },
    ],
  },
}

If both are configured, the subset in the function call is used.

Disable preloading for that font

If it's not possible to preload your intended subset you can disable preloading.

const notoSansJapanese = Noto_Sans_JP({
  weight: '400',
  preload: false,
})

Useful Links

Specifying a subset