For awhile now I've seen this same error in the console:
Uncaught TypeError: Cannot read property 'defaultView' of undefined
at $e (jquery.min.js:2)
at Fe (jquery.min.js:2)
at Function.css (jquery.min.js:2)
at jquery.min.js:2
at z (jquery.min.js:2)
at w.fn.init.css (jquery.min.js:2)
at HTMLDocument.<anonymous> (<anonymous>:3:24)
at l (jquery.min.js:2)
at c (jquery.min.js:2)
The error cites jquery.min.js, and I don't use "defaultView" anywhere in my code, so I assumed it wasn't anything in my own code. And it's not a fatal error, so not really a big deal. But today I had a little free time, so I decided to see if I could track it down. Google didn't really give me anything except for a few vague references to possibly referring to something that didn't exist or was null, so that wasn't a lot of help.
The error is on every page of the site except for the homepage, so step one, narrow it down to Javascript that's on every page... that's my universal .js file, easy enough. So I commented out a huge block of script, uploaded it, and voila, no more error! Yay! So the error is obviously within that big chunk, right?
So I started uncommenting sections at a time, in an attempt to narrow it down even further.
After about 30 minutes of this, I finally had it narrowed down to 3 lines:
// "scroll" is a predefined object
var sectionHeight, asideHeight;
if (scroll.section && scroll.aside) {
sectionHeight = $(scroll.section).height() + 800;
asideHeight = $(scroll.aside).height();
}
So I change it to this:
var sectionHeight =
asideHeight = 0;
if (scroll.section && $(scroll.section).height())
sectionHeight = $(scroll.section).height() + 800;
if (scroll.aside && $(scroll.aside).height())
asideHeight = $(scroll.aside).height();
Yay, no more error!
Then, 3 more pageviews later... error's back. Exact same error, with no guidance on where it might be originating >:-(
So I've ended up spending the day working on an error that may not even be on my end, and that's not even important, just cause it bugs me.