Budibase/budibase · error · Error
Error enriching PWA icons: ${error}
Error message
Error enriching PWA icons: ${error} What it means
When serving an app HTML page, serveApp tries to enrich the head with PWA icon links (manifest/apple-touch-icon). If that enrichment logic throws for any reason, it is wrapped in 'Error enriching PWA icons: <error>' — meaning the app render fails because icon metadata could not be resolved or templated.
Source
Thrown at packages/server/src/api/controllers/static/index.ts:616
try {
// Enrich all icons
const enrichedIcons = await objectStore.enrichPWAImages(
appInfo.pwa.icons
)
let appleTouchIcon = enrichedIcons.find(
icon => icon.sizes === "180x180"
)
if (!appleTouchIcon && enrichedIcons.length > 0) {
appleTouchIcon = enrichedIcons[0]
}
if (appleTouchIcon) {
extraHead += `<link rel="apple-touch-icon" sizes="${appleTouchIcon.sizes}" href="${appleTouchIcon.src}">`
}
} catch (error) {
throw new Error("Error enriching PWA icons: " + error)
}
}
}
ctx.body = await processString(appHbs, {
head: `${head}${extraHead}`,
body: body,
css: `:root{${themeVariables}}`,
appId: workspaceId,
embedded: bbHeaderEmbed,
nonce: ctx.state.nonce,
})
} else {
// just return the app info for jest to assert on
ctx.body = { ...appInfo, clientCacheKey, clientLibPath }
}
} catch (error: any) {
let msg = "An unknown error occurred"View on GitHub (pinned to a81a902e9a)
Solutions
- Read the wrapped root cause in the message and fix the underlying icon metadata issue
- Re-upload valid PWA icons via the PWA zip flow to regenerate metadata
- Remove/reset the PWA icon configuration for the app if icons are no longer needed
- Check object storage for the icon keys referenced by the workspace metadata
Defensive patterns
Strategy: try-catch
Validate before calling
// verify icon objects are intact before relying on PWA rendering
const ok = icon => icon && typeof icon.src === "string" && typeof icon.sizes === "string"
if (pwaConfig?.manifest?.icons && !pwaConfig.manifest.icons.every(ok)) throw new Error("corrupt PWA icon metadata") Type guard
const isValidIcon = (i) => Boolean(i) && typeof i === "object" && typeof i.src === "string" && typeof i.sizes === "string"
Try / catch
try {
html = await fetch(appUrl).then(r => r.text())
} catch (e) {
if (/Error enriching PWA icons/.test(e.message)) {
// re-upload or reset PWA icons for the workspace, then retry
} else throw e
} Prevention
- Re-upload icons after any object-storage cleanup
- Avoid hand-editing workspace PWA metadata
- Rebuild PWA config from a fresh icon zip after migrations
- Monitor storage for deleted icon keys
When it happens
Trigger: Requesting an app page whose workspace has partial/corrupt PWA icon metadata — e.g. manifest.icon points to a deleted object, appleTouchIcon fields are undefined/malformed, or an exception inside the icon-resolution try block (bad S3 key, template interpolation failure).
Common situations: Icons deleted from storage after PWA was configured; an earlier upload failure (error 342) leaving inconsistent icon metadata; hand-edited workspace metadata with missing sizes/src.
Related errors
- Cannot render an empty flow chain
- Invalid zip
- Invalid zip - directory depth exceeds ${MAX_PWA_ZIP_DEPTH}
- Invalid zip - too many files (max ${MAX_PWA_ZIP_FILE_COUNT})
- Invalid zip - file "${entry.fileName}" exceeds the maximum s
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/8ef9ecdc07f7c7f5.
Report an issue: GitHub.