Messages.js:232 Uncaught TypeError: is not a function


I am getting following error on save document. Document is saving first time, but not in the consecutive changes. However, if I reload the form and make changes it is going through and the cycle repeats.

I am unable to trace the source of error in the javascript file with the following error.

messages.js:232 Uncaught TypeError: is not a function
    at frappe.msgprint (messages.js:232:18)
    at messages.js:148:11
    at Array.forEach (<anonymous>)
    at frappe.msgprint (messages.js:147:12)
    at frappe.request.cleanup (request.js:428:12)
    at Object.<anonymous> (request.js:300:19)
    at fire (jquery.js:3500:31)
    at Object.fireWith [as resolveWith] (jquery.js:3630:7)
    at done (jquery.js:9796:14)
    at XMLHttpRequest.<anonymous> (jquery.js:10057:9)
frappe.msgprint @ messages.js:232

Please help.

This has been resolved.
Actually, there was


in my py file method. I just removed the entry.