Clicking edit button on front end throws error "Uncaught RangeError: Maximum call stack size exceeded"
I am currently having issues with a site where the edit buttons on the front end are not working. After clicking an edit button the console shows "Uncaught RangeError: Maximum call stack size exceeded" (see attached). And after the edit popup loads, the text editor is not displayed (also attached). I can click the "Advanced" and "Simple" buttons and some Uncaught TypeErrors are then thrown. (third attachment).
Any hints on where I should look first to solve this?
I have tried switching to the "default" theme, and they work fine there. I compared whats in my theme's master templates to other themes and I haven't found anything out of the ordinary that I can see would cause the buttons to break (no extra JS calls or plugins being loaded).
Any answers on this? I am having the same problem after upgrading to SF 6.0.