Error - Uncaught TypeError: t.replace is not a function

I get this error randonly on saving a document - and once this error comes I cannot do any activity like save or submit on the form until I refresh the screen.

Anyone else facing this issue? any ideas how to fix this?

desk.min.js:256 Uncaught TypeError: t.replace is not a function
    at replace_newlines (http://192.168.1.240/assets/js/desk.min.js:256:41)
    at Object.frappe.msgprint (http://192.168.1.240/assets/js/desk.min.js:90:5)
    at http://192.168.1.240/assets/js/desk.min.js:82:75
    at Array.forEach (native)
    at Object.frappe.msgprint (http://192.168.1.240/assets/js/desk.min.js:82:48)
    at Object.frappe.request.cleanup (http://192.168.1.240/assets/js/desk.min.js:140:118)
    at Object.<anonymous> (http://192.168.1.240/assets/js/desk.min.js:133:16)
    at i (http://192.168.1.240/assets/frappe/js/lib/jquery/jquery.min.js:2:27151)
    at Object.fireWith [as resolveWith] (http://192.168.1.240/assets/frappe/js/lib/jquery/jquery.min.js:2:27914)
    at z (http://192.168.1.240/assets/frappe/js/lib/jquery/jquery.min.js:4:12059)```

What version are you on? For starters, you can try updating.