Hello,
you should debug it looking at the actual response sent by your Moodle server: unfortunately Moodle doesn't show you the plain response in case of issues like yours about a malformed JSON so you need to capture and inspect it by your own, by "simply" using the Developer Tools of your browser.
An example about how to do it for a different issue: https://tracker.moodle.org/browse/MDL-60691?focusedCommentId=597479&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-597479
HTH,
Matteo