<?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 ArcGIS Experience Builder Widget: WebMap add() fails with &amp;quot;item is not a layer&amp;quot; due to a race condition. in Experience Builder Custom Widgets</title>
    <link>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1640357#M621</link>
    <description>&lt;P&gt;Hello GIS friends,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Thank you for your help and time.&lt;BR /&gt;Abi&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Aug 2025 14:19:05 GMT</pubDate>
    <dc:creator>AbiDhakal</dc:creator>
    <dc:date>2025-08-08T14:19:05Z</dc:date>
    <item>
      <title>ArcGIS Experience Builder Widget: WebMap add() fails with "item is not a layer" due to a race condition.</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1640357#M621</link>
      <description>&lt;P&gt;Hello GIS friends,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Thank you for your help and time.&lt;BR /&gt;Abi&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 14:19:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1640357#M621</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2025-08-08T14:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Experience Builder Widget: WebMap add() fails with "item is not a layer" due to a race condition.</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1659301#M647</link>
      <description>&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout" target="_blank"&gt;https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I use setTimeout a lot. Sometimes there is just no practical solution, but adding a 50-500 millisecond delay using setTimeout. Often using more elegant methods like reactiveUtils or the layers ready property fail because the object must be written to memory before they will work and by the time they are they are in the ready state.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 13:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1659301#M647</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2025-10-21T13:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Experience Builder Widget: WebMap add() fails with "item is not a layer" due to a race condition.</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1659590#M648</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;. I appreciate your response and idea. I will have to give that a shot when I'm working on another widget, and the issue arises again.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 12:54:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/arcgis-experience-builder-widget-webmap-add-fails/m-p/1659590#M648</guid>
      <dc:creator>AbiDhakal</dc:creator>
      <dc:date>2025-10-22T12:54:45Z</dc:date>
    </item>
  </channel>
</rss>

