I am getting this error only in Safari and Chrome on Mac machine, but can't reproduce on other browsers nor on Windows. The main problem - there is no information on what function caused the issue. No stack trace with most recent calls before the exception. And even the "Pause on exceptions" setting is not working. It's not paused on this exception, only puts the information to console.
How can I troubleshoot what is causing the issue, on what function it crashes, what was the call stack before crash? Or how can I log all the function calls(important note, the profiler should be started immediately after page load).
I have managed to find the point that was causing the error, so here are some advises for those who will face a same issue: