{"record":{"id":"b9e00deee077d295","repo":"vercel/next.js","slug":"invalid-display-value-for-font-available-di","errorCode":null,"errorMessage":"Invalid display value {} for font {}.\nAvailable display values: {}","messagePattern":"Invalid display value (.+?) for font (.+?)\\.\nAvailable display values: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/next-core/src/next_font/google/options.rs","lineNumber":167,"sourceCode":"            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    }\n\n    if let Some(axes) = argument.axes.as_ref()\n        && !axes.is_empty()\n    {\n        if !supports_variable_weight {\n            anyhow::bail!(\"Axes can only be defined for variable fonts.\")\n        }\n\n        if weights != FontWeights::Variable {\n            anyhow::bail!(\n                \"Axes can only be defined for variable fonts when the weight property is \\\n                 nonexistent or set to `variable`.\"","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/crates/next-core/src/next_font/google/options.rs#L149-L185","documentation":"Thrown by options_from_request() when the `display` property (CSS font-display descriptor) is not one of the allowed values: auto, block, swap, fallback, optional. These correspond to the CSS font-display spec values; anything else is rejected.","triggerScenarios":"Passing `display: 'none'`, `display: 'hidden'`, or any string outside the allowed set to a Google font. Defaults to 'swap' when omitted, so this only fires on an invalid explicit value.","commonSituations":"Confusing font-display with CSS `display`; typo like 'swp'; passing a non-spec value.","solutions":["Use one of: 'auto', 'block', 'swap', 'fallback', 'optional'.","Omit `display` to accept the default 'swap'."],"exampleFix":"// before\nconst font = Inter({ subsets: ['latin'], display: 'visible' })\n// after\nconst font = Inter({ subsets: ['latin'], display: 'swap' })","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict display to one of: auto, block, swap, fallback, optional.","Omit display to accept the 'swap' default.","Remember font-display is distinct from CSS display."],"tags":["next-font","google-font","font","display","css","rust"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}