I'm getting the following error when I click on a MapView. I'm using jsapi 4.4
MapView.js:699 Uncaught TypeError: Cannot read property 'position' of undefined at Object.b.hitTest (https://js.arcgis.com/4.4/esri/views/MapView.js:699:292) at Object.c.hitTest (https://js.arcgis.com/4.4/esri/views/MapView.js:694:137) at https://js.arcgis.com/4.4/esri/views/MapView.js:735:50 at Array.map (native) at Object.c.hitTest (https://js.arcgis.com/4.4/esri/views/MapView.js:735:12) at Object._clickHandler (https://js.arcgis.com/4.4/init.js:2063:27) at https://js.arcgis.com/4.4/init.js:49:303 at a._callback (https://js.arcgis.com/4.4/esri/views/MapView.js:625:178) at c._handleEvent (https://js.arcgis.com/4.4/esri/views/MapView.js:560:71) at Object.eventCallback (https://js.arcgis.com/4.4/esri/views/MapView.js:556:401)
Solved! Go to Solution.
Just FYI for the next weary googler. Currently in 4.4, hitTest will fail with this error if any of your layers fail to properly load. In my case, a hosted feature service had an issue with a data store, and was in a state where it could not be queried with a where clause. Because the hitTest method checks all layers, there is a hitTest method in the features view class which does not check for a null pointer, and therefore throws an uncaught error crashing the entire application.
Just FYI for the next weary googler. Currently in 4.4, hitTest will fail with this error if any of your layers fail to properly load. In my case, a hosted feature service had an issue with a data store, and was in a state where it could not be queried with a where clause. Because the hitTest method checks all layers, there is a hitTest method in the features view class which does not check for a null pointer, and therefore throws an uncaught error crashing the entire application.