diff --git a/apps/web/src/components/ui/typography/SyntaxHighlight/SyntaxHighlighter.tsx b/apps/web/src/components/ui/typography/SyntaxHighlight/SyntaxHighlighter.tsx
index 7510a6c1d..2c01ca997 100644
--- a/apps/web/src/components/ui/typography/SyntaxHighlight/SyntaxHighlighter.tsx
+++ b/apps/web/src/components/ui/typography/SyntaxHighlight/SyntaxHighlighter.tsx
@@ -62,7 +62,7 @@ export const SyntaxHighlighter = ({
);
})
) : (
- {children}
+ {children || ''}
)}
);
@@ -126,10 +126,11 @@ const Line: React.FC<{
Line.displayName = 'Line';
const SyntaxFallback: React.FC<{ children: string; fallbackColor?: string }> = ({
- children,
+ children = '',
fallbackColor = 'inherit',
}) => {
- const fallbackChildren: Pick[][] = children
+ const ensureString = typeof children === 'string' ? children : '';
+ const fallbackChildren: Pick[][] = (ensureString || '')
.split('\n')
.map((line) => {
return [