I've created a WebMap which has a deliberate error - a layer is missing. Using the standard ArcGIS JS API approach, this is handled unobtrusively, with the WebMap loading without the broken layer:
By contrast, the react-arcgis library throws a fatal error and returns "the ArcGIS API failed to load" when it encounters the same webmap:
Expected behavior
Rather than failing with a fatal error, the react-arcgis WebMap should just ignore the broken layer, as in the core JS API behaviour.
I've created a WebMap which has a deliberate error - a layer is missing. Using the standard ArcGIS JS API approach, this is handled unobtrusively, with the WebMap loading without the broken layer:
By contrast, the react-arcgis library throws a fatal error and returns "the ArcGIS API failed to load" when it encounters the same webmap:
https://codesandbox.io/s/load-failed-webmap-1jf3u?file=/src/index.js
Expected behavior Rather than failing with a fatal error, the react-arcgis WebMap should just ignore the broken layer, as in the core JS API behaviour.
To Reproduce
See the simple demo at https://codesandbox.io/s/load-failed-webmap-1jf3u?file=/src/index.js and compare with the non-React version at https://codepen.io/slead/pen/bGwBRVw
Additional context As a workaround, I used the
esri-loader
approach without react-arcgis and was able to avoid this issue.