I am using ArcGIS javascript API 4.3 for loading map in my Asp.Net MVC web application.
The map loads fine on my local machine but it does not load when I deploy my build on the server machine which is a Windows Server 2012 machine, the map does not load up and browser console complains something about "require" function not defined. I checked on my peer developer's machine and on that also map loads correctly but on server it still does not load.
I am using following script headers related to ArcGIS core files:
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
I am suspecting it might be an issue of CORS.
Can somebody please guide me what should I do to fix this issue? Please elaborate the solution as I don't know details of CORS much.
Hello Faisal,
If you are testing your solution in a browser on the server machine itself check through your network tab in developers tool that it downloaded all scripts successfully. Generally, due to security policy on server machines it's behavior is different than client machines or in some cases it may be blocking asynchronous calls in the background. Also as you suspect, it could be the CORS issue.
Thanks.