{"record":{"id":"5618d61a8a96ae0c","repo":"withastro/astro","slug":"these-families-will-not-be-merged-together-the-la","errorCode":null,"errorMessage":"These families will not be merged together. The last occurrence will override previous families for this cssVariable. Review your Astro configuration.","messagePattern":"These families will not be merged together\\. The last occurrence will override previous families for this cssVariable\\. Review your Astro configuration\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/assets/fonts/core/get-or-create-font-family-assets.ts","lineNumber":27,"sourceCode":"}: {\n\tfontFamilyAssetsByUniqueKey: FontFamilyAssetsByUniqueKey;\n\tlogger: AstroLogger;\n\tbold: (input: string) => string;\n\tfamily: ResolvedFontFamily;\n}) {\n\tconst key = `${family.cssVariable}:${family.name}:${family.provider.name}`;\n\tlet fontAssets = fontFamilyAssetsByUniqueKey.get(key);\n\tif (!fontAssets) {\n\t\tif (\n\t\t\tArray.from(fontFamilyAssetsByUniqueKey.keys()).find((k) =>\n\t\t\t\tk.startsWith(`${family.cssVariable}:`),\n\t\t\t)\n\t\t) {\n\t\t\tlogger.warn(\n\t\t\t\t'assets',\n\t\t\t\t`Several font families have been registered for the ${bold(family.cssVariable)} cssVariable but they do not share the same name and provider.`,\n\t\t\t);\n\t\t\tlogger.warn(\n\t\t\t\t'assets',\n\t\t\t\t'These families will not be merged together. The last occurrence will override previous families for this cssVariable. Review your Astro configuration.',\n\t\t\t);\n\t\t}\n\t\tfontAssets = {\n\t\t\tfamily,\n\t\t\tfonts: [],\n\t\t\tcollectedFontsForMetricsByUniqueKey: new Map(),\n\t\t\tpreloads: [],\n\t\t};\n\t\tfontFamilyAssetsByUniqueKey.set(key, fontAssets);\n\t}\n\treturn fontAssets;\n}\n","sourceCodeStart":9,"sourceCodeEnd":42,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/assets/fonts/core/get-or-create-font-family-assets.ts#L9-L42","documentation":"Companion warning to 'Several font families have been registered for the X cssVariable...': it states the consequence — the families will not be merged, and the last occurrence registered for that cssVariable overrides all previous ones. Fonts from the earlier entries are silently dropped from the generated @font-face set and preloads for them disappear.","triggerScenarios":"Same as the collision: two or more font config entries share a cssVariable with differing name/provider; the final entry wins and earlier families' files are never emitted.","commonSituations":"Wondering why only one of two configured families loads in the browser; subtle font regressions after adding a new family that reuses an existing variable.","solutions":["Make each cssVariable unique per family (or drop the explicit cssVariable for unique defaults)","Ensure entries sharing a variable have identical name and provider so they intentionally merge","Verify the fix in devtools: the CSS variable should resolve to a stack containing every intended family"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Assert every emitted cssVariable resolves to exactly one family\nconst seen = new Map();\nfor (const f of fonts) {\n  if (seen.has(f.cssVariable) && seen.get(f.cssVariable) !== `${f.name}|${f.provider}`) {\n    throw new Error(`last-wins override for ${f.cssVariable}`);\n  }\n  seen.set(f.cssVariable, `${f.name}|${f.provider}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After font config changes, inspect the rendered CSS variable in devtools to confirm every intended family is present","Remember the override direction: the LAST entry for a shared cssVariable wins silently","Keep families that should merge identical in name and provider"],"tags":["fonts","css-variable","configuration","experimental-assets"],"backgroundTag":"duplicate-css-variable-conflict","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}