SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

While Saving The Form or Doctype i’m Getting This Error

Error

Unable to handle failed response
request.js:327 SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at frappe.request.report_error (request.js:483:18)
    at 500 (request.js:202:20)
    at Object.<anonymous> (request.js:320:6)
    at i (jquery.min.js:2:27151)
    at Object.fireWith [as rejectWith] (jquery.min.js:2:27914)
    at z (jquery.min.js:4:12084)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4:15619)
1 Like

I got this error because when in my hooks file there is before_save event function is there that funtion triggers. from there some errors occurred. That’s why I’m getting this error after changing that issue its resolver