{"record":{"id":"6b5d9739cf9d1d36","repo":"remotion-dev/remotion","slug":"meta-fontfamily-is-not-available-as-a-variable-font","errorCode":null,"errorMessage":"${meta.fontFamily} is not available as a variable font","messagePattern":"(.+?) is not available as a variable font","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/google-fonts/src/base.ts","lineNumber":259,"sourceCode":"\treturn {\n\t\tfontFamily: meta.fontFamily,\n\t\tfonts: meta.fonts,\n\t\tunicodeRanges: meta.unicodeRanges,\n\t\twaitUntilDone: () => Promise.all<void>(promises).then(() => undefined),\n\t};\n};\n\nexport const loadVariableFonts = (\n\tmeta: FontInfo,\n\tstyle: string,\n\toptions: FontLoadOptions & {subsets: string[]},\n): {\n\tfontFamily: FontInfo['fontFamily'];\n\taxes: Record<string, {min: number; max: number}>;\n\twaitUntilDone: () => Promise<undefined>;\n} => {\n\tif (!meta.variable) {\n\t\tthrow new Error(`${meta.fontFamily} is not available as a variable font`);\n\t}\n\n\tif (options.subsets.length === 0) {\n\t\tthrow new Error('Pass at least one subset to loadVariableFont()');\n\t}\n\n\tconst fontFacesForStyle = meta.variable.fontFaces.filter(\n\t\t(fontFace) => fontFace.style === style,\n\t);\n\tif (fontFacesForStyle.length === 0) {\n\t\tthrow new Error(\n\t\t\t`The variable font ${meta.fontFamily} does not have a style ${style}`,\n\t\t);\n\t}\n\n\tconst availableSubsetKeys = fontFacesForStyle.map(\n\t\t(fontFace) => fontFace.subset,\n\t);","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/google-fonts/src/base.ts#L241-L277","documentation":"loadVariableFonts() (exported from @remotion/google-fonts) loads variable font axes, but only works for fonts whose metadata marks them as variable (`meta.variable` present). For static-only families the variable info does not exist, so calling this function throws `${fontFamily} is not available as a variable font`.","triggerScenarios":"Calling loadVariableFonts(fontInfo, style, {subsets: [...]}) with a FontInfo meta object for a family that has no variable version — e.g. fonts like \"Arial\"-style static families, or families where the package only ships static weights. Also happens when passing meta from the wrong family (copy-paste between imports).","commonSituations":"Migrating code from loadFont() to loadVariableFonts() without checking that the chosen family offers a variable font on Google Fonts, using an older package version where the family had no variable metadata, or destructuring meta from one import and passing it to another family's loader.","solutions":["Use `loadFont()` instead of `loadVariableFonts()` for families without a variable version — it loads static weights per style/weight","Pick a family that actually ships a variable font on Google Fonts (check the family page for an \"axes\" panel)","Verify the meta object belongs to the intended family (it comes from the same family's import, e.g. `import {getInfo} from \"@remotion/google-fonts/Inter\"`)","If the family does have a variable font on Google Fonts, update @remotion/google-fonts to a version whose generated metadata includes it"],"exampleFix":"// before\nimport {loadVariableFonts, getInfo} from \"@remotion/google-fonts/Roboto\";\nloadVariableFonts(getInfo(), \"normal\", {subsets: [\"latin\"]}); // static-only family\n// after\nimport {loadFont} from \"@remotion/google-fonts/Roboto\";\nconst {fontFamily, waitUntilDone} = loadFont(\"normal\", {weights: [\"400\", \"700\"]});","handlingStrategy":"try-catch","validationCode":"import {getInfo} from \"@remotion/google-fonts/Inter\";\nconst meta = getInfo();\nif (!meta.variable) {\n  // fall back to loadFont() for static weights\n}\n","typeGuard":"const supportsVariable = (\n  meta: ReturnType<typeof getInfo>,\n): meta is typeof meta & {variable: NonNullable<typeof meta.variable>} =>\n  Boolean(meta.variable);","tryCatchPattern":"try {\n  const vf = loadVariableFonts(meta, style, {subsets: ['latin'], ...options});\n} catch (e) {\n  if (e.message.includes('is not available as a variable font')) {\n    // fall back to loadFont(meta.fontFamily === undefined ? style : style, ...)\n    return loadFont(style as any, options);\n  }\n  throw e;\n}","preventionTips":["Check `getInfo().variable` before calling loadVariableFonts()","Use loadFont() by default; only switch to loadVariableFonts() for variable-capable families","Import meta and loader from the same family module to avoid mismatched objects","Keep @remotion/google-fonts updated so newly variable fonts have metadata"],"tags":["google-fonts","api-misuse","variable-fonts"],"backgroundTag":"unsupported-operation","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}