question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: elem.getClientRects is not a function

See original GitHub issue

I ran into this issue after jquery@2.2.0 was installed during a unit test build:

  • TypeError: elem.getClientRects is not a function at Array.jQuery.expr.filters.visible (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:8909:63) at site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:2198:22 at superMatcher (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:2419:12) at Sizzle.select (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:2599:44) at Sizzle (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:864:9) at Function.Sizzle.matches (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:1400:9) at Function.jQuery.filter (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:2764:15) at winnow (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:2744:18) at [object Object].jQuery.fn.extend.filter (site/node_modules/somepackage/node_modules/jquery/dist/jquery.js:2796:26) at Object.kickOffMethod (site/file.js:24:16)

note: site/node_modules/somepackage is an internal package so I just masked it with that path

When I install jquery@2.1.4, all of my unit tests pass.

I poked around at my source and i see it trying to use the :visible filter like so:

$('selector:visible');

and it seems to be failing there.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dmethvincommented, Jun 27, 2016

@cancerberoSgx “this” was fixed several months ago in jsdom, unless you are referring to a different “this”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery UI error - f.getClientRects is not a function
It's extremely weird. jQuery.Deferred exception: elem.getClientRects is not a function TypeError: elem.getClientRects ...
Read more >
"elem.getClientRects is not a function" when using jQuery 3.0
I just downloaded the latest version of colorpicker here today, and I noticed that the demo was not working in Chrome 55.
Read more >
Uncaught TypeError: r.getClientRects is not a function
The error console keeps showing Uncaught TypeError: r.getClientRects is not a function every time the popup fires. Any help here would be great....
Read more >
Uncaught TypeError X.getClientRects is not a function
The X.getClientRects is not a function error occurs when trying to open the drop-down list with export options from the viewer's toolbar.
Read more >
Updated jQuery: "r.getClientRects is not a function"
1. I'm getting the error message in the console: r. getClientRects is not a function. I've been Googling this, and coming up with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found