<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1344302#M82645</link>
    <description>&lt;P&gt;I am migrating my web application from the 3.x&amp;nbsp; to 4.x Esri javascript api. I need to load "esri/identity/IdentityManager" module to access by token to my arcgis server&amp;nbsp;rest services. It works fine, if I don't load dojo. But It fails when I load it. It comes out this error:&lt;BR /&gt;dojo.js.uncompressed.js:1770 GET &lt;A href="https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/esri/identity/IdentityManager.js" target="_blank" rel="noopener"&gt;https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/esri/identity/IdentityManager.js&lt;/A&gt; net::ERR_ABORTED 404&lt;/P&gt;&lt;P&gt;It looks like the application is looking for the esri module in the dojo toolkit...&lt;/P&gt;&lt;P&gt;Below I am adding a sample in which I've commented the references to the IdentityManager . This way it works. For this sample there is no need to use the token, but I include it to make it easier to understand the case.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
    
    &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
    &amp;lt;title&amp;gt;DOJO and Esri javascript api 4.X&amp;lt;/title&amp;gt;
	&amp;lt;!-- Load dojo  --&amp;gt;
	&amp;lt;script src="https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.28/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.28/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;script&amp;gt;
      require([
	  
	  "esri/layers/FeatureLayer",
        "esri/rest/support/Query",
		//If commented references to IdentityManager, there is no problem
		//"esri/identity/IdentityManager", 
		 "dojo/dom", "dojo/on", 
		"dojo/domReady!"
      ], function (FeatureLayer, Query, 
	 // esriId,
	  dom, on) {
	  	
		var tokenStr="63dJGeEz6333YPz6T07uLpGEbbVsnRPLqVVnEVkqhUq.";
		
			var token = {
			  "server": "https://sampleserver6.arcgisonline.com/arcgis/rest/services",				
			  "token": tokenStr
			};
		//	esriId.registerToken(token);
			
      const countiesLayer = new FeatureLayer({
          url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/3"
        });
	
		let queryCounties = countiesLayer.createQuery();
		queryCounties.returnGeometry = false;
		queryCounties.where = "state_name ='Washington'";
		queryCounties.outFields = [ "OBJECTID", "state_name" ];
		
		on(dom.byId("execute"), "click", execute);

		
	   function execute () {
		 countiesLayer.queryFeatures(queryCounties)
		  .then(function(response){
		document.write(response.features[0].attributes.state_name);		
		});

      }	
			
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;   
    &amp;lt;input id="execute" type="button" value="Query County"&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 10:40:07 GMT</pubDate>
    <dc:creator>AlbertoPinilla</dc:creator>
    <dc:date>2023-11-01T10:40:07Z</dc:date>
    <item>
      <title>Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1344302#M82645</link>
      <description>&lt;P&gt;I am migrating my web application from the 3.x&amp;nbsp; to 4.x Esri javascript api. I need to load "esri/identity/IdentityManager" module to access by token to my arcgis server&amp;nbsp;rest services. It works fine, if I don't load dojo. But It fails when I load it. It comes out this error:&lt;BR /&gt;dojo.js.uncompressed.js:1770 GET &lt;A href="https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/esri/identity/IdentityManager.js" target="_blank" rel="noopener"&gt;https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/esri/identity/IdentityManager.js&lt;/A&gt; net::ERR_ABORTED 404&lt;/P&gt;&lt;P&gt;It looks like the application is looking for the esri module in the dojo toolkit...&lt;/P&gt;&lt;P&gt;Below I am adding a sample in which I've commented the references to the IdentityManager . This way it works. For this sample there is no need to use the token, but I include it to make it easier to understand the case.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
    
    &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
    &amp;lt;title&amp;gt;DOJO and Esri javascript api 4.X&amp;lt;/title&amp;gt;
	&amp;lt;!-- Load dojo  --&amp;gt;
	&amp;lt;script src="https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.28/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.28/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;script&amp;gt;
      require([
	  
	  "esri/layers/FeatureLayer",
        "esri/rest/support/Query",
		//If commented references to IdentityManager, there is no problem
		//"esri/identity/IdentityManager", 
		 "dojo/dom", "dojo/on", 
		"dojo/domReady!"
      ], function (FeatureLayer, Query, 
	 // esriId,
	  dom, on) {
	  	
		var tokenStr="63dJGeEz6333YPz6T07uLpGEbbVsnRPLqVVnEVkqhUq.";
		
			var token = {
			  "server": "https://sampleserver6.arcgisonline.com/arcgis/rest/services",				
			  "token": tokenStr
			};
		//	esriId.registerToken(token);
			
      const countiesLayer = new FeatureLayer({
          url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/3"
        });
	
		let queryCounties = countiesLayer.createQuery();
		queryCounties.returnGeometry = false;
		queryCounties.where = "state_name ='Washington'";
		queryCounties.outFields = [ "OBJECTID", "state_name" ];
		
		on(dom.byId("execute"), "click", execute);

		
	   function execute () {
		 countiesLayer.queryFeatures(queryCounties)
		  .then(function(response){
		document.write(response.features[0].attributes.state_name);		
		});

      }	
			
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;   
    &amp;lt;input id="execute" type="button" value="Query County"&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 10:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1344302#M82645</guid>
      <dc:creator>AlbertoPinilla</dc:creator>
      <dc:date>2023-11-01T10:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345110#M82665</link>
      <description>&lt;P&gt;It appears that adding the dojoConfig settings (particularly with the "packages" property set) prior to loading dojo resolves the problem:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
&amp;lt;title&amp;gt;DOJO and Esri javascript api 4.X&amp;lt;/title&amp;gt;
&amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.28/esri/themes/light/main.css" /&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
	window.dojoConfig = {
		async: true,
		cacheBust: "0.0.1",
		has: {},
		isDebug: true,
		locale: "en-us",
		parseOnLoad: false,
		packages: [
			{name:"esri", location:"https://js.arcgis.com/4.28/esri"}
		]
	};
&amp;lt;/script&amp;gt;
&amp;lt;script src="https://ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="https://js.arcgis.com/4.28/"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
	require([
		"esri/layers/FeatureLayer",
		"esri/rest/support/Query",
		"esri/identity/IdentityManager", 
		"dojo/dom",
		"dojo/on", 
		"dojo/domReady!"
	], function (FeatureLayer, Query, esriId, dom, on) {
		var tokenStr = "63dJGeEz6333YPz6T07uLpGEbbVsnRPLqVVnEVkqhUq.";
		var token = {
			"server": "https://sampleserver6.arcgisonline.com/arcgis/rest/services",				
			"token": tokenStr
		};

		esriId.registerToken(token);
			
		const countiesLayer = new FeatureLayer({
			url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/3"
		});

		let queryCounties = countiesLayer.createQuery();
		queryCounties.returnGeometry = false;
		queryCounties.where = "state_name ='Washington'";
		queryCounties.outFields = [ "OBJECTID", "state_name" ];
		
		on(dom.byId("execute"), "click", execute);

		function execute () {
			countiesLayer.queryFeatures(queryCounties).then(function(response) {
				document.write(response.features[0].attributes.state_name);		
			});
		}	
	});
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;   
	&amp;lt;input id="execute" type="button" value="Query County" /&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:16:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345110#M82665</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-11-02T17:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345136#M82667</link>
      <description>&lt;P&gt;Hi, Joel,&amp;nbsp;I sensed that the solution was related to &lt;STRONG&gt;&lt;EM&gt;dojoConfig&lt;/EM&gt; &lt;/STRONG&gt;but I couldn't get any results. Thanks a lot for the answer!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:52:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345136#M82667</guid>
      <dc:creator>AlbertoPinilla</dc:creator>
      <dc:date>2023-11-02T17:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345145#M82668</link>
      <description>&lt;P&gt;If you reference dojo via cdn and the Maps SDK via CDN, you are loading the dojo loader twice.&lt;/P&gt;&lt;P&gt;You should probably point the dojo path to previous versions of the Maps SDK CDN. You can even reference all the old dojo related libs if you need them, but it is &lt;EM&gt;highly&lt;/EM&gt; recommended you stop using these and migrate to native js/browser implementations.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/4.25/#removal-of-non-esri-packages-from-cdn" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/4.25/#removal-of-non-esri-packages-from-cdn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script&amp;gt;
  window.dojoConfig = {
    packages: [{
        name: "dojo",
        location: "../../3.42/dojo"
      },
      {
        name: "dijit",
        location: "../../3.42/dijit"
      },
      {
        name: "dojox",
        location: "../../3.42/dojox"
      },
      {
        name: "dgrid1",
        location: "../../3.42/dgrid1"
      },
      {
        name: "dstore",
        location: "../../3.42/dstore"
      }
    ]
  };
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 18:01:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345145#M82668</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-11-02T18:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345180#M82670</link>
      <description>&lt;P&gt;Thank you very much for your answer, Rene, I take into account. When you recommend migrate to native js/browser implementations, do you mean giving up using dojo, jquery,.. libraries?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 18:36:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345180#M82670</guid>
      <dc:creator>AlbertoPinilla</dc:creator>
      <dc:date>2023-11-02T18:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345548#M82679</link>
      <description>&lt;P&gt;dom.byId can be replaced with document.getElementById, and dojo/on is just a shortcut for addEventListener. You don't need domReady in modern browsers today. There's really no reason to rely on those dojo utilities in your apps today.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 14:57:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345548#M82679</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-11-03T14:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error on using IdentityManager when loading dojo with Esri Javascript Api 4.x</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345967#M82688</link>
      <description>&lt;P&gt;Thanks for your answer, Rene.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 06:07:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-on-using-identitymanager-when-loading-dojo/m-p/1345967#M82688</guid>
      <dc:creator>AlbertoPinilla</dc:creator>
      <dc:date>2023-11-06T06:07:33Z</dc:date>
    </item>
  </channel>
</rss>

