jQuery UI error - f.getClientRects is not a function
<p>I'm trying to make jQuery UI work, but it doesn't. Here's what happens.</p>
<p>I'm loading dependencies:</p>
<pre><code>&lt;script src=&quot;assets/src/js/angular/angular.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;assets/src/js/angular-animate/angular-animate.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;assets/src/js/angular-route/angular-route.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;assets/src/js/jquery/dist/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;assets/src/js/jquery-ui/jquery-ui.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;assets/src/js/app.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;assets/src/js/main.js&quot;&gt;&lt;/script&gt;
</code></pre>
<p>That's my <strong>main.js</strong> file:</p>
<pre><code>$(function () {
    $(&quot;input[type=submit]&quot;)
        .button()
        .click(function (event) {
            event.preventDefault();
        });
});


$(function () {
    $(&quot;#circum&quot;).buttonset();
});

$(function () {
    $(&quot;#dialog-message&quot;).dialog({
        modal: true,
        buttons: {
            Ok: function () {
                $(this).dialog(&quot;close&quot;);
            }
        }
    });
});
</code></pre>
<p>When I run the code in Brackets jQuery UI is loaded but doesn't work, however, when I comment my <em>main.js</em> file out and then bring it back that's the error I get in the console and UI is suddenly working. It's extremely weird.</p>
<pre><code>jQuery.Deferred exception: elem.getClientRects is not a function TypeError: elem.getClientRects is not a function
at jQuery.offset (http://127.0.0.1:27530/assets/src/js/jquery/dist/jquery.js:9779:14)
at Object.getWithinInfo (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:1157:26)
at jQuery.$.fn.position (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:1179:23)
at _position (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:8709:17)
at ._position (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:415:25)
at open (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:8334:8)
at .open (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:415:25)
at _init (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:8210:9)
at ._init (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:415:25)
at _createWidget (http://127.0.0.1:27530/assets/src/js/jquery-ui/jquery-ui.js:587:8) undefined
</code></pre>
<p>I've found this thread discussing the issue, but still wasn't able to fix it.</p>
<p><a href="https://github.com/jquery/jquery/issues/2804" rel="noreferrer">Github</a></p>
<p>Cheers.</p>