Select to view content in your preferred language

Proxied MapImageLayer fails to load Sublayer details

05-22-2024 02:48 AM
New Contributor II

I have a Single Page Application (SPA), which is accessible under


In addition I have a MapServer hosted on a local arcgis server instance with the following URL


Due to authentication in production, this MapServer must be proxied through my backend , which handles authentication against the ArcGIS server services. So the service is accessible through the following URL


Now in that SPA, I create a MapImageLayer instance using the proxy URL:



import MapImageLayer from "@arcgis/core/layers/MapImageLayer.js";

const layer = new MapImageLayer({
  url: 'http://localhost:8080/proxy/myservice'
await layer.load();

const sublayer =;
await sublayer.load();




At first everything seems fine, because



assert(sublayer.loadStatus === 'loaded')




does not fail, but members like fields, renderer or labeling info are not populated properly.


So I took a look at my browsers network log, which logs a 404 request to


I assume that this request should fetch the Sublayer details, such as fields, renderer or labeling info. But instead of instantiating the request relative to the SPA's root, the Sublayer details should be fetched relative to the layer proxy URL:



Is this actually a bug in the SDK, or something I can fix on my side?

---------------------------------------------------------------- 2024-06-20 - Edit ----------------------------------------------------------------

Note: The proxy implementation is irrelevant here. The bug can be reproduced with any proxy.

Tags (3)
0 Kudos
1 Reply
New Contributor II
0 Kudos