I cannot figure out where MapkitJS and esri-loader are having issues together. From researching on here and elsewhere, it seems like there is likely a naming conflict with another package. Here is a link of the resolved issue for esri-loader. I read all the pages on that link.
I have a site that uses both MapkitJs and ArcGIS. Mapkit has always worked fine until I brought in ArcGIS. Both scripts are lazy loaded via a provider. After reading about the issues, I wait until Mapkit is initialized before loading the ArcGIS script.
The first thing I noticed was the ability to rotate maps in Mapkit immediately went away (it loads, then takes it away after about 1/2 second). That was my first hint something is conflicting.
If I remove esri-loader's call loadModules, which loads the script, the rotate works again. If I add it again (even if I don't specify any modules to add), it break Mapkit rotate.
Here is the main problem. If I create a mapkit map first, then try to create an ArcGIS map, it pops the error. But if I create an ArcGIS map first, and then the mapkit second, it's fine (except the apple mapkit map can't rotate).
I wish I could provide more information, but I don't even know where to start on this one. Please ask me what you need...
I uploaded a demo page to my site. If you go to https://dieselplanning.com/ it'll start with an Esri map loaded first. It works, you can switch maps (bottom left button in the sidebar). You'll also see the compass rose at the bottom right flash for a second on apple maps as it accepts rotation then decides not to shortly after creation.
However, if you go to https://dieselplanning.com/test it's the same exact page as the ao page, but it creates a mapkit map first. That will create issues when you swap maps.
