{"record":{"id":"080a8ae2c1060870","repo":"actualbudget/actual","slug":"font-file-ref-cleanpath-exceeds-maximum-size","errorCode":null,"errorMessage":"Font file \"${ref.cleanPath}\" exceeds maximum size of ${MAX_FONT_FILE_SIZE / 1024 / 1024}MB.","messagePattern":"Font file \"(.+?)\" exceeds maximum size of (.+?)MB\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/desktop-client/src/style/customThemes.ts","lineNumber":613,"sourceCode":"\n  // Fetch fonts sequentially to enforce a running total size budget\n  const fetched: { ref: FontRef; dataUri: string }[] = [];\n  let totalBytes = 0;\n  for (const ref of fontRefs) {\n    const fontUrl = baseUrl + ref.cleanPath;\n    const perFontTimeout = AbortSignal.timeout(FONT_FETCH_TIMEOUT_MS);\n    const fetchSignal = signal\n      ? AbortSignal.any([signal, perFontTimeout])\n      : perFontTimeout;\n    const response = await fetch(fontUrl, { signal: fetchSignal });\n    if (!response.ok) {\n      throw new Error(\n        `Failed to fetch font file \"${ref.cleanPath}\" from ${fontUrl}: ${response.status} ${response.statusText}`,\n      );\n    }\n    const buffer = await response.arrayBuffer();\n    if (buffer.byteLength > MAX_FONT_FILE_SIZE) {\n      throw new Error(\n        `Font file \"${ref.cleanPath}\" exceeds maximum size of ${MAX_FONT_FILE_SIZE / 1024 / 1024}MB.`,\n      );\n    }\n    totalBytes += buffer.byteLength;\n    if (totalBytes > MAX_TOTAL_FONT_SIZE) {\n      throw new Error(\n        `Total embedded font data exceeds maximum of ${MAX_TOTAL_FONT_SIZE / 1024 / 1024}MB.`,\n      );\n    }\n    const base64 = arrayBufferToBase64(buffer);\n    fetched.push({ ref, dataUri: `data:${ref.mime};base64,${base64}` });\n  }\n\n  // Replace each url() reference with its data: URI\n  let result = css;\n  for (const { ref, dataUri } of fetched) {\n    const q = ref.quote || \"'\";\n    result = result.replace(ref.fullMatch, `url(${q}${dataUri}${q})`);","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/desktop-client/src/style/customThemes.ts#L595-L631","documentation":"Error \"Font file \"${ref.cleanPath}\" exceeds maximum size of ${MAX_FONT_FILE_SIZE / 1024 / 1024}MB.\" thrown in actualbudget/actual.","triggerScenarios":"Thrown at packages/desktop-client/src/style/customThemes.ts:613 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}