interact.js: Uncaught TypeError: Cannot read property 'pageX' of undefined
This error originates from the pointerMove event listener, initiating a call chain to setEventXY and getPageXY, where evidently the pointer is has been passed in as undefined.
Seen on Google Chrome and Chrome Mobile, running on WIndows 8.1, Android 4.4, Windows (version undefined) and Linux.
getPageXY should handle null pointer exceptions (no pun intended).
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 5
- Comments: 55 (24 by maintainers)
I’ve pushed a thing to the stable branch to avoid PointerEvents in Chrome. If you’re using
v1.2.*, updating tov1.2.8should solve this issue when it’s related to PointerEvents.@taye I haven’t tried the unstable branch, but I can easily reproduce this issue in Chrome 55.0.2883.75 on http://interactjs.io/
Steps to reproduce:
Uncaught TypeError: Cannot read property 'pageX' of undefinedappears in the console.Alternative reproduction: The error appears simply by moving your mouse onto the webpage from the browser chrome area (tabs, address bar, bookmarks, etc).
I get (above) error “Cannot read property ‘pageX’ of undefined” when moving my mouse in and out of the chrome browser window
Same issue here.
Could you please update the download on interact.io to version 1.2.8? Thanks!
I’m sorry for the not sorting this out after so long. I’ll begin to investigate this issue again in the coming days.
There’s a new
unstablebuild. Please update and and report any issues. A demo to reproduce this bug would be very helpful as I haven’t encountered it.in the meantime, you can use the 1.2.8 version from a CDN.
Here is the stacktrace I am getting for this error:
It seems that in some cases, using touch events, the
this.addPointer(pointer)is not called and pointer is not added tothis.pointersarray and becomesundefinedas @73rhodes mentioned. One, not perfect but possible way would be to callthis.addPointer(pointer)once it’s not found during recording:We’re seeing the exact same issue reported too, however I’m not able to replicate it on demand myself.
I’m using leaflet.js on the page, and get this error when dragging the map…
The unstable branch doesn’t work for me (using browserify)
Cannot find module './src/utils/window' from 'node_modules/interact.js/dist