{"record":{"id":"7312a3238f17e8dc","repo":"remotion-dev/remotion","slug":"weight-weight-subset-subset-is-not-availab","errorCode":null,"errorMessage":"weight: ${weight} subset: ${subset} is not available for '${meta.fontFamily}'","messagePattern":"weight: (.+?) subset: (.+?) is not available for '(.+?)'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/google-fonts/src/base.ts","lineNumber":143,"sourceCode":"\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,\n\t\t\t\t\t\t\tmetaSubsets: meta.subsets,\n\t\t\t\t\t\t\trequestedSubset,\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t];\n\t\t\tfor (const subset of subsets) {\n\t\t\t\t//  Get font url from meta\n\t\t\t\tlet font = meta.fonts[style]?.[weight]?.[subset];\n\n\t\t\t\t//  Check is font available in meta\n\t\t\t\tif (!font) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`weight: ${weight} subset: ${subset} is not available for '${meta.fontFamily}'`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t//  Check is font already loaded\n\t\t\t\tlet fontKey = `${meta.fontFamily}-${style}-${weight}-${subset}`;\n\t\t\t\tconst previousPromise = loadedFonts[fontKey];\n\t\t\t\tif (previousPromise) {\n\t\t\t\t\tpromises.push(previousPromise);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst baseLabel = `Fetching ${meta.fontFamily} font ${JSON.stringify({\n\t\t\t\t\tstyle,\n\t\t\t\t\tweight,\n\t\t\t\t\tsubset,\n\t\t\t\t})}`;\n","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/google-fonts/src/base.ts#L125-L161","documentation":"Thrown by @remotion/google-fonts `loadFonts` when, for a resolved (style, weight, subset) combination, no font URL exists in the metadata. Subsets are expanded through `resolveFontSubsetKeys`, so a requested subset may map to a metadata subset that the chosen weight does not provide; the lookup `meta.fonts[style][weight][subset]` then returns undefined.","triggerScenarios":"Requesting `{weights: ['400'], subsets: ['latin-ext']}` for a weight that only ships 'latin'; requesting a subset that does not exist for the family at all; passing a subset string with incorrect casing or spelling.","commonSituations":"Assuming every weight offers every subset; using a subset name from a different font's docs; the family dropped a subset in a newer version of the metadata.","solutions":["Inspect `Object.keys(meta.fonts[style][weight])` to see which subsets the specific weight provides.","Restrict `subsets` to values present in `meta.subsets` and in the per-weight metadata.","Omit `subsets` to load all subsets available for the requested weights."],"exampleFix":"// before\nloadFonts(meta, 'normal', {weights: ['400'], subsets: ['latin-ext', 'cyrillic']});\n\n// after\nconst validSubsets = Object.keys(meta.fonts['normal']['400']);\nloadFonts(meta, 'normal', {weights: ['400'], subsets: validSubsets});","handlingStrategy":"validation","validationCode":"function availableSubsets(meta: FontInfo, style: string, weight: string): string[] {\n  return Object.keys(meta.fonts[style]?.[weight] ?? {});\n}\n\nconst subsets = requestedSubsets.filter((s) => availableSubsets(meta, 'normal', '400').includes(s));\nloadFonts(meta, 'normal', {weights: ['400'], subsets});","typeGuard":"function subsetExists(meta: FontInfo, style: string, weight: string, subset: string): boolean {\n  return Object.prototype.hasOwnProperty.call(meta.fonts[style]?.[weight] ?? {}, subset);\n}","tryCatchPattern":null,"preventionTips":["Cross-check requested subsets against both meta.subsets and the per-weight keys.","Omit subsets to load every subset the requested weights provide.","Beware casing: subset keys are lowercase identifiers like 'latin-ext'."],"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"}