ArcGIS Experience Builder Widget: WebMap add() fails with "item is not a layer" due to a race condition.

86
0
a week ago
Labels (2)
AbiDhakal
Frequent Contributor

Hello GIS friends,

I'm encountering a persistent race condition in my ArcGIS Experience Builder widget, developed using developer edition 1.17 for ArcGIS Enterprise 11.5. The console shows [esri.WebMap] #add() The item being added is not a layer or a promise that resolves to a layer. While also displaying my custom success log, "GraphicLayer added to map." This indicatges that the add() call fails asynchronously while the code proceeds, leading to a subsequent Uncaught TypeError when the Sketch widget attempts to use the failed layer. Despite having implemented wait on both graphicLayer.load() and jimuMapView.view.map.add(graphicLayer) to fix the timing, the error persists. I'm looking for a solution or a robust workaround to resolve this race condition and successfully add a GraphicLayer for my Sketch widget.

Thank you for your help and time.
Abi 

0 Kudos
0 Replies