Error after updating to Javascript 3.12

2375
5
12-22-2014 09:44 AM
by Anonymous User
Not applicable

I updated my app to 3.12 and am getting the following error:

Uncaught TypeError: Cannot read property 'toString' of undefined 

It is being triggered by the following line:

init.js:899
function(c,a,d){c=k.getObject(a,!1,g);d&&(c=k.getObject(d,!1,b).call(b,c,a));return e(c,a).toString()}

Any ideas? It was working fine in 3.11. Thanks

0 Kudos
5 Replies
KellyHutchins
Esri Frequent Contributor

Without seeing a code example that shows the problem its hard to say what is causing your app to fail after migrating to 3.12. Do you have a test case that shows the problem?

0 Kudos
HeikoHeijenga
Esri Contributor

The code snippet you supplied is from dojo/string.substitute. Can you supply the entire stack trace when this error occured?

0 Kudos
by Anonymous User
Not applicable

It is hard to send a code sample since this error occurs onload.  Here is the stack trace from the error as well as the code for which is being called out (coords.js)

error.PNG

require([

  "dojo/dom",

  "dojo/on",

  "dijit/Menu",

  "dijit/MenuItem",

  "dijit/MenuSeparator",

  "dijit/layout/ContentPane",

  "dojo/number",

  "esri/geometry/Point",

  "esri/geometry/webMercatorUtils",

        "dojo/domReady!"

    ], function(dom, on, Menu, MenuItem, MenuSeparator, ContentPane, number, Point, webMercatorUtils) {

  var currentLocation;

  //Right Click Menu

  var coordMenu = new Menu({

  id: "menu",

  targetNodeIds: ["map"],

  onOpen: function(box) {

  currentLocation = getMapPointFromMenuPosition(box);

  var coords = webMercatorUtils.webMercatorToGeographic(currentLocation);

  var latitude = number.format(coords.y, {places:6, type: "decimal"});

  var longitude = number.format(coords.x, {places:6, type: "decimal"});

  dom.byId("coordsDisplay").innerHTML = "<div id=\"coordsSelect\">" + latitude + ", " + longitude + "</div>";

  }

  });

  coordMenu.addChild(new ContentPane({

  content:"<div id=\"coordsDisplay\"></div>"

  }));

  coordMenu.addChild(new MenuItem({

            label: "Close",

  iconClass: "dijitIconDelete"

        }));

  coordMenu.startup();

  function getMapPointFromMenuPosition(box) {

  var x = box.x, y = box.y;

  switch( box.corner ) {

  case "TR":

  x += box.w;

  break;

  case "BL":

  y += box.h;

  break;

  case "BR":

  x += box.w;

  y += box.h;

  break;

  }

  var screenPoint = new Point(x - map.position.x, y - map.position.y);

  return map.toMap(screenPoint);

        }

  });

0 Kudos
YungKaiChin
Occasional Contributor

Mostly likely a timing issue.

Does your app still run properly?

0 Kudos
by Anonymous User
Not applicable

Yeah I figured its a timing issue when the app is parsed.  It does not run when updated to 3.12, still troubleshooting.

0 Kudos