diff --git a/packages/string-templates/src/index.ts b/packages/string-templates/src/index.ts index 0f5326374f..55b2587b99 100644 --- a/packages/string-templates/src/index.ts +++ b/packages/string-templates/src/index.ts @@ -179,7 +179,11 @@ export function processObjectSync( for (let key of Object.keys(object || {})) { let val = object[key] if (typeof val === "string") { - object[key] = processStringSync(object[key], context, opts) + try { + object[key] = processStringSync(object[key], context, opts) + } catch (error: any) { + object[key] = error.toString() + } } else if (typeof val === "object") { object[key] = processObjectSync(object[key], context, opts) }