Select to view content in your preferred language

Upgrading to Arcgis 4.12 throws an error: ERROR TypeError: Cannot read property '1' of undefined

3006
9
08-28-2019 04:13 PM
DanLokman
Emerging Contributor

We use Arcgis for javascript 4.11 and after loading the map on the UI, everything works fine. However, we just upgraded to use version 4.12 and we are getting the following error on page load. Can someone please help us resolve this? Thanks

core.js:15713 ERROR TypeError: Cannot read property '1' of undefined
at a.getData (engine.js:448)
at a.getVVSize (engine.js:447)
at a.reset (engine.js:468)
at a.reset (engine.js:465)
at a.run (engine.js:457)
at Object.e._applyVisivilityPass (mapViewDeps.js:8)
at u (mapViewDeps.js:9)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17279)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)

0 Kudos
9 Replies
mgeorge
Esri Contributor

Hi Dan Lokman‌! Unfortunately the fix for this didn't quite make it into 4.12, but it will be there for 4.13.

DanLokman
Emerging Contributor

Thanks. Good to know. How do you know it'll be fixed in 4.13? Do you have a reference url or article? Thanks

0 Kudos
mgeorge
Esri Contributor

Ah, I work on the labeling and fixed this issue in another context, which I think should fix this one as well. Not sure if we plan on exposing a 4.13 pre-release yet, but I'll get back to you on that. 

DanLokman
Emerging Contributor

Thanks a bunch. We'll surely test with 4.13 once it comes out and will let you guys know....

0 Kudos
RoyJackson2
Occasional Contributor

Depending on the labeling settings with featureserver and featurelayers, the application will:

1 - Cause the layers to not load at all, and the application becomes broken if the layers are open by default

          If the layers are not on by default, and then turned on by the user, the app does work.  

2 - Cause the application to throw errors during drawing

Example Error:

ERROR TypeError: Cannot read property '1' of undefined
    at a.getData (engine.js:448)
    at a.getVVSize (engine.js:447)
    at a.reset (engine.js:468)
    at a.reset (engine.js:465)
    at a.run (engine.js:457)
    at Object.e._applyVisivilityPass (mapViewDeps.js:8)
    at u (mapViewDeps.js:9)
    at t.invokeTask (polyfills.6128a76cb46d689e5adb.js:1)
    at Object.onInvokeTask (main.4f6b201b924958ab72f9.js:1)
    at t.invokeTask (polyfills.6128a76cb46d689e5adb.js:1)
It is fairly frustrating when certain api errors cause the esri code / map to stop working altogether... is there any kind of global error handler we can tap into to allow the app to proceed after hitting some problem?   We have a couple other similar things going on that we need a strategy for getting around.  
Thank you
0 Kudos
mgeorge
Esri Contributor

Hmm this is a good idea, I'll discuss and see if there is something we can do on this front. 

mgeorge
Esri Contributor

Quick update on this - after some discussion we agreed that these types of errors should not stop rendering. We'll be taking a look at our error handling to see where we can improve. Probably we need to be wrapping more calls in catch blocks that recover and log the error.

SurajJha1
Regular Contributor

Hi Matt, 

I am getting exactly the same issue when one of my layer is loading. Can you please let us know the fix you have applied? Published layer type is polyline and using ArcGIS API for javascript 4,12 and server version is 10.6.1. What I am guessing there may be labeling issue with the layer because in code if I set the labelinginfo : null this error does not appear.

Thanks 

Suraj

mgeorge
Esri Contributor

The fix is in our 4.13 development build, I'll let you know as soon as there's something we can share.

0 Kudos