vercel/next.js · error
Unknown style {} for font {}. Available styles: {}
Error message
Unknown style {} for font {}.
Available styles: {} What it means
Thrown by options_from_request() when a requested style (e.g. 'italic', 'normal') is not in the font's available styles list. The validator iterates requested styles and bails on the first one not found in font_data.styles, printing the valid set.
Source
Thrown at crates/next-core/src/next_font/google/options.rs:155
let mut weights = vec![];
for weight in requested_weights {
weights.push(weight.parse()?);
}
FontWeights::Fixed(weights)
};
if styles.is_empty() {
if font_data.styles.len() == 1 {
styles.push(font_data.styles[0].clone());
} else {
styles.push(rcstr!("normal"));
}
}
for requested_style in &styles {
if !font_data.styles.contains(requested_style) {
anyhow::bail!(
"Unknown style {} for font {}.\nAvailable styles: {}",
requested_style,
font_family,
font_data.styles.join(", ")
)
}
}
let display = argument.display.unwrap_or_else(|| rcstr!("swap"));
if !ALLOWED_DISPLAY_VALUES.contains(&display.as_str()) {
anyhow::bail!(
"Invalid display value {} for font {}.\nAvailable display values: {}",
display,
font_family,
ALLOWED_DISPLAY_VALUES.join(", ")
)
}View on GitHub (pinned to 0ae8c72462)
Solutions
- Use a style from the 'Available styles' in the error message.
- Omit the style property to accept the default (the single available style, or 'normal').
- Switch to a font family that ships the style you need.
Example fix
// before
const font = Archivo({ subsets: ['latin'], style: 'italic' }) // Archivo may lack italic
// after
const font = Archivo({ subsets: ['latin'] }) Defensive patterns
Strategy: validation
Prevention
- Verify the font supports the requested style before passing it.
- Omit style to accept the default when unsure.
- Check the Google Fonts listing for available styles (normal/italic).
When it happens
Trigger: Passing `style: 'italic'` to a font that only supports 'normal', or a typo'd/invalid style string.
Common situations: Assuming a font has an italic variant when it doesn't; copy-pasting style from another font; case or spelling mistake.
Related errors
- Only zero or one arguments to font functions are currently s
- Missing weight for {}. Available weights: {}
- Unexpected `variable` in weight array for font {}. You only
- Unknown weight {} for font {}. Available weights: {}
- Invalid display value {} for font {}. Available display valu
AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06).
Data as JSON: /api/errors/b3f7af6e7d9d7d50.
Report an issue: GitHub.