{errors[0].longMessage as React.ReactNode}
- {showMore && !canFixInLens ? ( ++ {typeof firstError.longMessage === 'function' + ? firstError.longMessage() + : firstError.longMessage} +
+ {errors.length > 1 && !canFixInLens ? (
{messageGroup.map(({ longMessage }, i) => (
-
diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts
index f4063747e9b77..d22016f75620a 100644
--- a/x-pack/plugins/lens/public/types.ts
+++ b/x-pack/plugins/lens/public/types.ts
@@ -302,7 +302,7 @@ export interface UserMessage {
severity: 'error' | 'warning' | 'info';
hidePopoverIcon?: boolean;
shortMessage: string;
- longMessage: string | React.ReactNode | ((closePopover: () => void) => React.ReactNode);
+ longMessage: string | React.ReactNode | ((closePopover?: () => void) => React.ReactNode);
fixableInEditor: boolean;
displayLocations: UserMessageDisplayLocation[];
}