{"record":{"id":"87b3d21143fbfed0","repo":"remotion-dev/remotion","slug":"the-font-meta-fontfamily-does-not-have-a-style","errorCode":null,"errorMessage":"The font ${meta.fontFamily} does not have a style ${style}","messagePattern":"The font (.+?) does not have a style (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/google-fonts/src/base.ts","lineNumber":112,"sourceCode":"\t) {\n\t\tthrow new Error(\n\t\t\t'Loading Google Fonts without specifying weights and subsets is not supported in Remotion v5. Please specify the weights and subsets you need.',\n\t\t);\n\t}\n\n\tconst promises: Promise<void>[] = [];\n\tconst styles = style ? [style] : Object.keys(meta.fonts);\n\n\tlet fontsLoaded = 0;\n\n\tfor (const style of styles) {\n\t\t// Don't load fonts on server\n\t\tif (typeof FontFace === 'undefined') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!meta.fonts[style]) {\n\t\t\tthrow new Error(\n\t\t\t\t`The font ${meta.fontFamily} does not have a style ${style}`,\n\t\t\t);\n\t\t}\n\t\tconst weights = options?.weights ?? Object.keys(meta.fonts[style]);\n\t\tfor (const weight of weights) {\n\t\t\tif (!meta.fonts[style][weight]) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`The font ${meta.fontFamily} does not  have a weight ${weight} in style ${style}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst requestedSubsets: string[] =\n\t\t\t\toptions?.subsets ?? Object.keys(meta.fonts[style][weight]);\n\t\t\tconst availableSubsetKeys = Object.keys(meta.fonts[style][weight]);\n\t\t\tconst subsets = [\n\t\t\t\t...new Set(\n\t\t\t\t\trequestedSubsets.flatMap((requestedSubset) =>\n\t\t\t\t\t\tresolveFontSubsetKeys({\n\t\t\t\t\t\t\tavailableSubsetKeys,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/google-fonts/src/base.ts#L94-L130","documentation":"Thrown by @remotion/google-fonts `loadFonts` when the requested `style` argument does not exist as a key in `meta.fonts` for the chosen font family. Each Google Font family advertises a fixed set of styles (commonly 'normal' and sometimes 'italic'); requesting one that the family does not provide is rejected.","triggerScenarios":"Calling `loadFonts(meta, 'italic', ...)` for a family whose metadata only contains a 'normal' key, or passing a style string with a typo such as 'normaL'. The check is `!meta.fonts[style]`.","commonSituations":"Hard-coding 'italic' for a font that has no italic cut; switching font families without updating the style argument; passing the wrong `meta` object for the style you want.","solutions":["Inspect `Object.keys(meta.fonts)` for the family to see which styles are valid, then pass one of those.","Omit the `style` argument entirely to load all available styles for the family.","Switch to a font family that actually ships the style you need."],"exampleFix":"// before\nloadFonts(meta, 'italic', {weights: ['400'], subsets: ['latin']});\n\n// after\nconst style = Object.keys(meta.fonts).includes('italic') ? 'italic' : 'normal';\nloadFonts(meta, style, {weights: ['400'], subsets: ['latin']});","handlingStrategy":"validation","validationCode":"function pickStyle(meta: FontInfo, wanted: string): string | undefined {\n  const available = Object.keys(meta.fonts);\n  return available.includes(wanted) ? wanted : undefined;\n}\n\nconst style = pickStyle(meta, 'italic');\nif (!style) throw new Error(`Style 'italic' not available; have: ${Object.keys(meta.fonts).join(', ')}`);","typeGuard":"function styleExists(meta: FontInfo, style: string): boolean {\n  return Object.prototype.hasOwnProperty.call(meta.fonts, style);\n}","tryCatchPattern":null,"preventionTips":["Before hard-coding a style, log Object.keys(meta.fonts) for the family.","Omit the style argument to load all styles the family offers.","When swapping font families, re-check the available styles rather than reusing the old argument."],"tags":["google-fonts","validation","fonts"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}