{"record":{"id":"7a13d0d23df3f7ba","repo":"vercel/next.js","slug":"unknown-weight-for-font-available-weights","errorCode":null,"errorMessage":"Unknown weight {} for font {}.\nAvailable weights: {}","messagePattern":"Unknown weight (.+?) for font (.+?)\\.\nAvailable weights: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/next-core/src/next_font/google/options.rs","lineNumber":128,"sourceCode":"                font_data.weights.join(\", \")\n            )\n        }\n\n        FontWeights::Variable\n    } else if requested_weights.contains(\"variable\") {\n        if requested_weights.len() > 1 {\n            anyhow::bail!(\n                \"Unexpected `variable` in weight array for font {}. You only need `variable`, it \\\n                 includes all available weights.\",\n                font_family\n            )\n        }\n\n        FontWeights::Variable\n    } else {\n        for requested_weight in &requested_weights {\n            if !font_data.weights.contains(requested_weight) {\n                anyhow::bail!(\n                    \"Unknown weight {} for font {}.\\nAvailable weights: {}\",\n                    requested_weight,\n                    font_family,\n                    font_data.weights.join(\", \")\n                )\n            }\n        }\n\n        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 {","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/crates/next-core/src/next_font/google/options.rs#L110-L146","documentation":"Thrown by options_from_request() when a requested weight is not present in the font's available weights list (from the Google Fonts metadata). Each requested weight is checked against font_data.weights; any miss bails with the available set for guidance.","triggerScenarios":"Passing a weight the font doesn't offer, e.g. `weight: '450'` for a font that only has 400/700, or a typo'd weight string.","commonSituations":"Guessing a weight value; font family changed its available weights upstream; typo like '40' instead of '400'.","solutions":["Use a weight listed in the error message's 'Available weights'.","Double-check numeric weights are valid CSS font-weights the font actually ships (commonly 100–900 in steps).","If you wanted all weights, use `weight: 'variable'` for a variable font."],"exampleFix":"// before\nconst font = Merriweather({ subsets: ['latin'], weight: '450' })\n// after\nconst font = Merriweather({ subsets: ['latin'], weight: '400' })","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only request weights that appear in the font's available-weights list.","Use standard CSS weight numbers (100–900) that the font ships.","When unsure, omit weight for variable fonts (use 'variable')."],"tags":["next-font","google-font","font","weight","rust"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}