diff --git a/app/client/src/utils/Validators.ts b/app/client/src/utils/Validators.ts index 1ad8427f08..1b950e96ef 100644 --- a/app/client/src/utils/Validators.ts +++ b/app/client/src/utils/Validators.ts @@ -11,13 +11,20 @@ import { WIDGET_TYPE_VALIDATION_ERROR } from "constants/messages"; export const VALIDATORS: Record = { [VALIDATION_TYPES.TEXT]: (value: any): ValidationResponse => { let parsed = value; - if (_.isUndefined(value) || _.isObject(value)) { + if (_.isUndefined(value)) { return { isValid: false, parsed: "", message: `${WIDGET_TYPE_VALIDATION_ERROR}: text`, }; } + if (_.isObject(value)) { + return { + isValid: false, + parsed: JSON.stringify(value, null, 2), + message: `${WIDGET_TYPE_VALIDATION_ERROR}: text`, + }; + } let isValid = _.isString(value); if (!isValid) { try {