Cannot Click on tabs. either javascript exception thrown or all panels in view vanish

Experiencing some strange behaviour on both 7.13.3 and 7.12.2

When clicking on a tab within a User record:
The following error messages are generated and the tab is not selected and the view is not updated.

Failed to execute 'querySelectorAll' on 'Element': ':scope .active:last a' is not a valid selector.
Failed to execute 'querySelectorAll' on 'Document': '#' is not a valid selector.

I found these function calls on the line with the following:
return H.apply(n, f.querySelectorAll(c))
This code is found in the sugar_grp1_jquery.js javascript group file.

I attempted to figure out where in the source files this is located but without source maps I found this to be an impossibility.


the second strange behaviour which I believe to be related to the first mentioned.
When clicking on a tab in a Lead (Overview for example)
all panels in the content area dissapear.

I later discovered that a div with the following classes “panel panel-default” was given a display: none inline css rule.

So far I’ve attempted to remove the Security Suite Plugin.
replace all jssource files with fresh copies from a brand new 7.12 instance
replace all include/javascript files with fresh copies from a brand new 7.12 instance
replace all themes files with fresh copies from a brand new 7.12 instance

. UPDATE
I found the error message on a 7.13.3 instance that doesn’t have the issue
Failed to execute 'querySelectorAll' on 'Document': '#' is not a valid selector.
I’ll look deeper into this.

Is there any documentation on how the tab code works?

Further attempts at debugging this.
I’m trying to find the event listener on the tab that the user clicks on.

tried the following in Chrome
getEventListeners($('ul.nav.nav-tabs')[0])
result
{}
getEventListeners($('a#tab0')[0])
result
{}

Wasn’t an issue with the JavaScript
However I couldn’t figure out how to disable minification to more easily debug.

I ended up deleting the custom metadata for the views and everything started working as expected