It was an issue with microflow call from the script, added error handling for the microflow call fixed the issue.
Can you provide a little more context on when this issue occurs? What did you click, was it on a page, during a microflow activity, what kind of modules/widgets are installed and might be active?