AnsweredAssumed Answered

CORS  issue with demographics8.arcgis.com

Question asked by tcatkins99 on Sep 28, 2018
Latest reply on Oct 4, 2018 by tcatkins99

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 

esriConfig.request.trustedServers.push('https://demographics8.arcgis.com');

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.

 

Here's the two errors it's throwing:

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=<redacted>' 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=<redacted>","requestOptions":{"responseType":"image"},"ssl":false}}}

Outcomes