Select to view content in your preferred language

'Set' is undefined (API v 4.3, Internet Explorer only)

4244
3
06-09-2017 01:43 PM
DataSteward
Deactivated User

My map application is working beautifully in Chrome and FireFox.  But when I try it in Internet Explorer (v11), the api is looking like there is a glitch.  Nothing loads and my console shows this error:

SCRIPT5009: 'Set' is undefined

File: 4.3, Line: 18, Column: 307

Clicking to view that location in the debugger shows the cursor at the beginning of a throw statement within:

d.result=void 0===c&&d.cjs?d.cjs.exports:c;ra(d)}return d.result},ya=0,G=function(d){try{ya++,d()}catch(hb){throw hb;}finally{ya--}pa()&&D("idle",[])},

No errors or warnings are present to show possible issues arising from my own javascript coding.  Any suggestions on how to get past this?  Thanks!

0 Kudos
3 Replies
ThomasSolow
Frequent Contributor

It seems possible that IE 11 has limited support for Sets which are relatively new to JavaScript.  I'm not 100% sure this is the issue, and that page does indicate that basic support exists in IE 11.

I recommend using a polyfill like: es6-set and ensuring that it loads before the JS API, if only to rule out that this is the problem.

DataSteward
Deactivated User

Thanks Thomas, that was helpful, though it hasn't helped me to fully solve the problem. I can get IE to work with my map if I set the compatibility mode to 'edge' (though only if I do so manually).  By setting it with my html header meta, I can get most maps to load fine in IE, except when I load multiple ImageLayers (even if not set to visible).  For now, I guess I'll set my map up to only provide a single ImageLayer if the client is IE, along with a note to suggest using an alternate browser.

0 Kudos
ThomasSolow
Frequent Contributor

Okay, interesting.  I'd like to look into this but I don't have a windows machine to run IE  without jumping through a lot of hoops.

I can confirm that the JS API uses Sets.  If browser compatibility is the issue (some browsers not supporting some aspects of Sets that the API makes use of) then a polyfill seems like the only viable option.  Ideally that would be done in the API so users didn't have to worry about it.

IE 11 is supposed to work with the 4.XX API, and I understand that it's still widely used, so this seems like a pretty significant issue.

0 Kudos