Simple question: What is the correct way to remove a layer (ArcGISDynamicMapServiceLayer)?
We do constantly add and remove layers to/from a map object. We noticed that after remove and add there is an exception
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at Object._onLoadHandler (https://js.arcgis.com/3.17/init.js:1857:295)
at HTMLImageElement.<anonymous> (https://js.arcgis.com/3.17/init.js:63:154)
What is wrong? What is the meaning?