diff --git a/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx b/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx index ab7df6394..057860d7c 100644 --- a/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx +++ b/apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx @@ -28,8 +28,14 @@ export class MarkdownErrorBoundary extends Component< return { hasError: true }; } - componentDidCatch(_error: unknown, _errorInfo: ErrorInfo) { + componentDidCatch(error: unknown, errorInfo: ErrorInfo) { // Keep the original message visible without logging its potentially sensitive content. + const errorName = + error instanceof Error && error.name ? error.name : 'UnknownError'; + console.error('[chat-markdown] render failed', { + errorName, + hasComponentStack: Boolean(errorInfo.componentStack?.trim()), + }); } componentDidUpdate(prevProps: MarkdownErrorBoundaryProps) {