<?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: CORS  issue with demographics8.arcgis.com in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3945#M373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whoops! Totally missed that. My apologies. The service requires me to login, but it seems to work at 4.9 with&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;trustedServers&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/PyzGgB" title="https://codepen.io/noash/pen/PyzGgB"&gt;A Pen by noah&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2018 22:23:00 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2018-10-04T22:23:00Z</dc:date>
    <item>
      <title>CORS  issue with demographics8.arcgis.com</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3942#M370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In testing out the 4.9 API, I'm running into and issue around CORS with demographics8.arcgis.com. We're pulling a MapImageLayer from this domain and it's throwing a CORS error in the console. I've tried&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;esriConfig.request.trustedServers.push('https://demographics8.arcgis.com');&lt;/PRE&gt;&lt;P&gt;but that didn't help. Is there something else I need to do on my end? I'd really rather not setup a proxy since it was working in 4.8 but if that's what's required, then I'll do it. I'm wondering (hoping) if there's some issue on the Esri side for this? And for what it's worth, the legend for the layer does work--just the actual map part of the service is throwing this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the two errors it's throwing:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Access to Image at 'https://demographics8.arcgis.com/arcgis/rest/directories/arcgisoutput/USA_Demographics_and_Boundaries_2018_MapServer/x_____x8rpmfxe7ycCrgTOULj6txw..x_____x_ags_map00d241a884ec469dafb1aeebc2cb111d.png?token=&amp;lt;redacted&amp;gt;' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

and

{"error":{"name":"request:server","message":"Unable to load the resource","details":{"url":"https://demographics8.arcgis.com/arcgis/rest/directories/arcgisoutput/USA_Demographics_and_Boundaries_2018_MapServer/x_____x8rpmfxe7ycCrgTOULj6txw..x_____x_ags_map00d241a884ec469dafb1aeebc2cb111d.png?token=&amp;lt;redacted&amp;gt;","requestOptions":{"responseType":"image"},"ssl":false}}}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3942#M370</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2021-12-12T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: CORS  issue with demographics8.arcgis.com</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3943#M371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Todd, you might need to add the domain to the list of trustedServers using esriConfig.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #5c2699; font-weight: 300;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #5c2699; font-weight: 300;"&gt;example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #5c2699; font-weight: 300;"&gt;require&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8; font-weight: 300;"&gt;([&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16; font-weight: 300;"&gt;"esri/config"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8; font-weight: 300;"&gt;], &lt;/SPAN&gt;&lt;SPAN class="" style="color: #595959; font-weight: 300;"&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;esriConfig&lt;/SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8; font-weight: 300;"&gt;{ esriConfig.request.trustedServers.push(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16; font-weight: 300;"&gt;"[&amp;lt;protocol&amp;gt;//]&amp;lt;hostname&amp;gt;.&amp;lt;domain&amp;gt;[:&amp;lt;port&amp;gt;]"&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8; font-weight: 300;"&gt;); });&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request"&gt;config | API Reference | ArcGIS API for JavaScript 4.9&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This changed was described in a recent blog post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript/blog/2018/08/30/cors-and-the-arcgis-api-for-javascript-changes-coming-in-49"&gt;https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript/blog/2018/08/30/cors-and-the-arcgis-api-for-javascript-changes-coming-in-49&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 20:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3943#M371</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2018-10-04T20:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: CORS  issue with demographics8.arcgis.com</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3944#M372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Noah, I've tried that and no dice. (as noted in my original post &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 22:06:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3944#M372</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2018-10-04T22:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: CORS  issue with demographics8.arcgis.com</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3945#M373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whoops! Totally missed that. My apologies. The service requires me to login, but it seems to work at 4.9 with&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;trustedServers&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/PyzGgB" title="https://codepen.io/noash/pen/PyzGgB"&gt;A Pen by noah&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 22:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3945#M373</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2018-10-04T22:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: CORS  issue with demographics8.arcgis.com</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3946#M374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting, I'll have to investigate this some more on my side. We're&amp;nbsp;using app logins for our setup here so the user doesn't have to login to AGOL to see the premium layers. I'll look into it some more and see if something is up with our token or something but that'd be odd since the error is specific to CORS. Was just weird that it worked at 4.8 and stopped at 4.9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now, I've just switched the layer over to a FeatureLayer and it's working fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 22:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-issue-with-demographics8-arcgis-com/m-p/3946#M374</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2018-10-04T22:29:30Z</dc:date>
    </item>
  </channel>
</rss>

