{"record":{"id":"b3f7af6e7d9d7d50","repo":"vercel/next.js","slug":"unknown-style-for-font-available-styles","errorCode":null,"errorMessage":"Unknown style {} for font {}.\nAvailable styles: {}","messagePattern":"Unknown style (.+?) for font (.+?)\\.\nAvailable styles: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/next-core/src/next_font/google/options.rs","lineNumber":155,"sourceCode":"        let mut weights = vec![];\n        for weight in requested_weights {\n            weights.push(weight.parse()?);\n        }\n\n        FontWeights::Fixed(weights)\n    };\n\n    if styles.is_empty() {\n        if font_data.styles.len() == 1 {\n            styles.push(font_data.styles[0].clone());\n        } else {\n            styles.push(rcstr!(\"normal\"));\n        }\n    }\n\n    for requested_style in &styles {\n        if !font_data.styles.contains(requested_style) {\n            anyhow::bail!(\n                \"Unknown style {} for font {}.\\nAvailable styles: {}\",\n                requested_style,\n                font_family,\n                font_data.styles.join(\", \")\n            )\n        }\n    }\n\n    let display = argument.display.unwrap_or_else(|| rcstr!(\"swap\"));\n\n    if !ALLOWED_DISPLAY_VALUES.contains(&display.as_str()) {\n        anyhow::bail!(\n            \"Invalid display value {} for font {}.\\nAvailable display values: {}\",\n            display,\n            font_family,\n            ALLOWED_DISPLAY_VALUES.join(\", \")\n        )\n    }","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/crates/next-core/src/next_font/google/options.rs#L137-L173","documentation":"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.","triggerScenarios":"Passing `style: 'italic'` to a font that only supports 'normal', or a typo'd/invalid style string.","commonSituations":"Assuming a font has an italic variant when it doesn't; copy-pasting style from another font; case or spelling mistake.","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."],"exampleFix":"// before\nconst font = Archivo({ subsets: ['latin'], style: 'italic' }) // Archivo may lack italic\n// after\nconst font = Archivo({ subsets: ['latin'] })","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["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)."],"tags":["next-font","google-font","font","style","rust"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}