I'm facing a very strange issue with respect to the esri.tasks.locator
function. If I do a hard-refresh (Ctr+Shift+R), the map starts working without any error. But after that if just try to refresh again (normal F5), the console prints out
TypeError: esri.tasks.Locator is not a constructor
Then if I again do a hard-refresh, everything works normally. What could be the cause of this behavior? The code I'm using is as follows:
dojo.require("esri.map");
dojo.require("esri.tasks.locator");
.
.
.
var locator = new esri.tasks.Locator("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); // this line is throwing error if not hard-refreshed
var params = {address:"200 E Berry St", maxLocations:1};
locator.addressToLocations(params);
locator.on("address-to-locations-complete", function (evt) { ... } );