withastro/astro · warning

No data found for font family ${bold(family.name)}. Review y

Error message

No data found for font family ${bold(family.name)}. Review your configuration

What it means

During font resolution, the configured provider returned zero fonts for a family name (after applying your weights/styles/subsets filters). Astro warns 'No data found for font family X. Review your configuration' and skips the family, then queries the provider's catalog to print a closest-match suggestion (the follow-up warning) when the exact name is not served. The CSS variable for the family will not be backed by any @font-face, so text falls back to system fonts.

Source

Thrown at packages/astro/src/assets/fonts/core/compute-font-families-assets.ts:74

	// 500, 600, 700 as normal but also 500 as italic. That requires 2 families
	for (const family of resolvedFamilies) {
		const fontAssets = getOrCreateFontFamilyAssets({
			fontFamilyAssetsByUniqueKey,
			family,
		});

		const _fonts = await fontResolver.resolveFont({
			familyName: family.name,
			provider: family.provider,
			// We do not merge the defaults, we only provide defaults as a fallback
			weights: family.weights ?? defaults.weights,
			styles: family.styles ?? defaults.styles,
			subsets: family.subsets ?? defaults.subsets,
			formats: family.formats ?? defaults.formats,
			options: family.options,
		});
		if (_fonts.length === 0) {
			logger.warn(
				'assets',
				`No data found for font family ${bold(family.name)}. Review your configuration`,
			);
			const availableFamilies = await fontResolver.listFonts({ provider: family.provider });
			if (
				availableFamilies &&
				availableFamilies.length > 0 &&
				!availableFamilies.includes(family.name)
			) {
				logger.warn(
					'assets',
					`${bold(family.name)} font family cannot be retrieved by the provider. Did you mean ${bold(stringMatcher.getClosestMatch(family.name, availableFamilies))}?`,
				);
			}
			continue;
		}
		// The data returned by the provider contains original URLs. We proxy them.
		// TODO: dedupe?

View on GitHub (pinned to 52e6c34790)

Solutions

  1. Match the exact family name and casing as the provider lists it
  2. Read the very next warning — when the name is close to a catalog entry it suggests 'Did you mean X?'
  3. Relax weights/subsets/styles filters so at least one variant resolves
  4. Check network access to the provider API from your build environment

Example fix

// astro.config.mjs
// before
import { defineConfig, fontProviders } from 'astro/config';
fonts: [{ provider: fontProviders.google(), name: 'roboto mono', cssVariable: '--font-mono' }]

// after
fonts: [{ provider: fontProviders.google(), name: 'Roboto Mono', cssVariable: '--font-mono' }]
Defensive patterns

Strategy: validation

Validate before calling

// For local providers, verify files exist at config load time
import { existsSync } from 'node:fs';
const families = [{ name: 'Brand', provider: 'local', src: ['./src/assets/fonts/brand.woff2'] }];
for (const f of families) {
  for (const s of f.src ?? []) if (!existsSync(s)) throw new Error(`missing font file: ${s}`);
}

Prevention

When it happens

Trigger: A typo'd or wrongly-cased family name (e.g., 'roboto mono' instead of 'Roboto Mono'); a name that provider does not serve; weight/subset/style filters so narrow no variant matches; the provider API unreachable so resolution yields nothing.

Common situations: Copy-pasted font configs with wrong casing; CI environments blocking egress to the provider; uncommon weight+subset combinations eliminating all variants; forgetting to set `provider` for a family that only exists under a different provider.

Related errors


AI-assisted analysis of withastro/astro@52e6c34790 (2026-08-18). Data as JSON: /api/errors/9d486cc8480dd6de. Report an issue: GitHub.