<?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 Re: Layer loadError with JavaScript 3.12 API in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538107#M2566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you move loading the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;xhrPlugins.addCrossSiteXhr to the onLayersAdded event so that it doesnt load until after the map has finished loading all layers?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jan 2015 20:46:50 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2015-01-09T20:46:50Z</dc:date>
    <item>
      <title>Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538100#M2559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on upgrading to the 3.12 version of the ArcGIS JavaScript API, and I'm hitting a bit of a snag. If I create a separate page and add a layer to a map everything works fine, so I know I have the API set up correctly. However, in my application, there comes a point where if I create an ArcGISTiledMapServiceLayer, it is immediately created with a loadError of "Error: no match found". The error occurs before the layer is added to the map (and even if it's never added to the map). I'm trying to create the smallest possible set of code for reproducing the problem, but haven't been able to isolate where it's happening. I apologize for not including any code samples, due to that, and will continue to try and get to a point where I can.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More what I'm wondering is if anyone has hit this error before, and what it might mean. To make sure it wasn't my layer that was causing the problem, I have used multiple layers and I am currently trying with one of the ESRI base layers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;var layer = new ArcGISTiledMapServiceLayer('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer');" rel="nofollow" target="_blank"&gt;http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer');&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Fiddler, I've also noticed that when I do this, no http request is made to the endpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:21:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538100#M2559</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T16:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538101#M2560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually this kind of this is because of out of order declares. Have you added any new classes to your "require" without adding the alias to the "function"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:48:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538101#M2560</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2015-01-09T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538102#M2561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wondered about that, too, but have checked to make sure that the require statements line up with the aliases. Also, in what confuses me the most, in my JavaScript file that initializes things, if I create the layer in a function early in the process, the layer is created without error. However, in another function (in the same JavaScript file, and the same set of requires/aliases) that gets called later in the lifecycle, the layer gets created with the loadError.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538102#M2561</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T16:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538103#M2562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And, also, if I switch back to the older JavaScript API (3.9 or 3.11), things work fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538103#M2562</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T16:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538104#M2563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So simply changing from 3.12 to 3.11 fixes it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Are you using https and http combined? &lt;/P&gt;&lt;P&gt;2. do you specify a baseUrl in your dojo.config?&lt;/P&gt;&lt;P&gt;3. are you using sync or async in dojo.config&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 18:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538104#M2563</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2015-01-09T18:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538105#M2564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct, changing from 3.12 to 3.11 allows the application to run as usual, as does using 3.9. However, a simple test page that creates a map and adds a layer also works in 3.12 (using the same dojoConfig).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To answer your other questions:&lt;/P&gt;&lt;P&gt;1. I am using just http.&lt;/P&gt;&lt;P&gt;2. I do not specify a baseUrl in the dojoConfig.&lt;/P&gt;&lt;P&gt;3. async is set to false in the dojoConfig&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 18:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538105#M2564</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T18:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538106#M2565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, so I've identified the cause. I've attached an HTML file that will reproduce the problem I'm seeing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The page will fail to load the map as-is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is related to using dojo's xhrPlugins.addCrossSiteXhr method. Before that method is used, layers work fine. After that method is used, layers fail. It looks like that is stripping away some XHR references from the AdapterRegistry that the layers don't like having removed. If you change the version to 3.11, you'll still get an error in the JavaScript console, but the map will function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was the part I was missing. In our full application, it looks like after some widgets are initialized, but before the page is fully loaded, we're using this method to allow for push notifications. Any layers created after that section of code would fail to load, anything before that section worked fine. If I remove that call, the application functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to figure out how to work around it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 20:44:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538106#M2565</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T20:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538107#M2566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you move loading the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;xhrPlugins.addCrossSiteXhr to the onLayersAdded event so that it doesnt load until after the map has finished loading all layers?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 20:46:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538107#M2566</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2015-01-09T20:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538108#M2567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really. I could with the first layers to be added, but there are other (more dynamically created) layers that might be added later, which would be after the call to addCrossSiteXhr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to see if there is an alternative to addCrossSiteXhr or if there's a way to make it work nicer with the layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does seem like something changed in the ArcGIS API at 3.12 with this behavior, as the dojo versions between 3.11 and 3.12 are the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 20:54:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538108#M2567</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T20:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538109#M2568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you open a bug ticket? Sounds like you have a reproduceable case and if it worked at 3.11 and not at 3.12 that is definitely are error.,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 21:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538109#M2568</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2015-01-09T21:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538110#M2569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would if I knew where to do that. I don't see a place on the tech support page. Am I missing something?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 22:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538110#M2569</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-09T22:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538111#M2570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At version 3.11 of the JSAPI we didn't list services.arcgisonline.com in corsEnabledServers. So the layer is loaded via JSONP instead of XHR so the code path where dojox/xhrplugin is executed isn't being used and the layer loads and displays successfully .&amp;nbsp; The 'no match found' errors will appear in the console when the layer makes a request to get dynamic attribution and when esri/request fetches services.arcgisonline/rest/info to detect CORS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At 3.12 we added services.arcgisonline.com to corsEnabledServers so the layer now uses the XHP code path which means xhr plugin executes. This fails because services.arcgisonline.com hasn't been registered with the xhrPlugin and because the plugin is not aware of services.arcgisonline the request fails. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix this issue your app will need to register all hosts from corsEnabledServers with the xhrPlugin. Here's an example that shows how to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsbin.com/fawuzaruvi/1/edit" title="http://jsbin.com/fawuzaruvi/1/edit"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Are you using xhrPlugin because you are using dojo/xhr for some reason? If so is it possible in your use case to use esriRequest + corsEnabledServers? Doing so will also resolve the problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 00:32:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538111#M2570</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-01-14T00:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Layer loadError with JavaScript 3.12 API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538112#M2571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply, and the explanation of the differences. Your suggestion of the addition of the corsEnabledServers works great, though, in fact, we found that we didn't really need the call we had to the xhrPlugin after all, so we have removed that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 15:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/layer-loaderror-with-javascript-3-12-api/m-p/538112#M2571</guid>
      <dc:creator>MichaelLundin</dc:creator>
      <dc:date>2015-01-14T15:37:21Z</dc:date>
    </item>
  </channel>
</rss>

