<?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 Use ArcGIS API from another host server, using esri-loader in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/use-arcgis-api-from-another-host-server-using-esri/m-p/398360#M36691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a ReactJS app that uses the esri-loader library to lazy-load the&amp;nbsp;map API. Everything works well when we use the esri-loader defaults. Now, we have to bring our app in a network that has no access to the default, but must pull from another server that hosts the ArcGIS API. I know that the default URL is &lt;A href="https://js.arcgis.com/4.16/"&gt;https://js.arcgis.com/4.16/&lt;/A&gt;&amp;nbsp;so&amp;nbsp;I changed it. I tried passing an option with the url property like this:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;{url: 'https://internal-server.com/4.x/', css: 'https://internal-server.com/4.x/css/main.css'}&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the map fails to load. Looking at the browser dev tools' network tab, the issue is because dojo.js (or dojo-lite.js) cannot be found in&amp;nbsp;&lt;A href="https://internal-server.com/4.x/,"&gt;https://internal-server.com/4.x/,&lt;/A&gt;&amp;nbsp;I need to explicitly set the option's url property to&amp;nbsp;&lt;A href="https://internal-server.com/4.x/dojo/dojo-lite.js"&gt;https://internal-server.com/4.x/dojo/dojo-lite.js&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works in loading the dojo script, but the map fails again. I looked at the network tab and noticed that although the CSS and dojo-lite loaded,&lt;SPAN style="color: #c41a16; background-color: #f8f8f8;"&gt;&amp;nbsp;&lt;/SPAN&gt;the URL for things like the Map.js and MapView.js, etc. are missing the base URL. So instead of &lt;A href="https://internal-server.com/4.x/esri/views/MapView.js"&gt;https://internal-server.com/4.x/esri/views/MapView.js&lt;/A&gt;&amp;nbsp;, I'm seeing &lt;A href="https://esri/views/MapView.js"&gt;https://esri/views/MapView.js&lt;/A&gt;&amp;nbsp;, etc. I checked the server that hosts the API and&amp;nbsp;&lt;A href="https://internal-server.com/4.x/esri/views/MapView.js" style="color: #2989c5; text-decoration: none;"&gt;https://internal-server.com/4.x/esri/views/MapView.js&lt;/A&gt;, along with the other&amp;nbsp;scripts do exist. It's just that esri-loader doesn't seem to set the base URL. I've been following this documentation (&lt;A class="link-titled" href="https://www.npmjs.com/package/esri-loader" title="https://www.npmjs.com/package/esri-loader"&gt;esri-loader - npm&lt;/A&gt;), but having zero luck. I even tried passing a dojoConfig option with a baseUrl, property, but that didn't seem to help. Please help. Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2020 12:15:11 GMT</pubDate>
    <dc:creator>SalvadorFiesta</dc:creator>
    <dc:date>2020-09-15T12:15:11Z</dc:date>
    <item>
      <title>Use ArcGIS API from another host server, using esri-loader</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/use-arcgis-api-from-another-host-server-using-esri/m-p/398360#M36691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a ReactJS app that uses the esri-loader library to lazy-load the&amp;nbsp;map API. Everything works well when we use the esri-loader defaults. Now, we have to bring our app in a network that has no access to the default, but must pull from another server that hosts the ArcGIS API. I know that the default URL is &lt;A href="https://js.arcgis.com/4.16/"&gt;https://js.arcgis.com/4.16/&lt;/A&gt;&amp;nbsp;so&amp;nbsp;I changed it. I tried passing an option with the url property like this:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;{url: 'https://internal-server.com/4.x/', css: 'https://internal-server.com/4.x/css/main.css'}&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the map fails to load. Looking at the browser dev tools' network tab, the issue is because dojo.js (or dojo-lite.js) cannot be found in&amp;nbsp;&lt;A href="https://internal-server.com/4.x/,"&gt;https://internal-server.com/4.x/,&lt;/A&gt;&amp;nbsp;I need to explicitly set the option's url property to&amp;nbsp;&lt;A href="https://internal-server.com/4.x/dojo/dojo-lite.js"&gt;https://internal-server.com/4.x/dojo/dojo-lite.js&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works in loading the dojo script, but the map fails again. I looked at the network tab and noticed that although the CSS and dojo-lite loaded,&lt;SPAN style="color: #c41a16; background-color: #f8f8f8;"&gt;&amp;nbsp;&lt;/SPAN&gt;the URL for things like the Map.js and MapView.js, etc. are missing the base URL. So instead of &lt;A href="https://internal-server.com/4.x/esri/views/MapView.js"&gt;https://internal-server.com/4.x/esri/views/MapView.js&lt;/A&gt;&amp;nbsp;, I'm seeing &lt;A href="https://esri/views/MapView.js"&gt;https://esri/views/MapView.js&lt;/A&gt;&amp;nbsp;, etc. I checked the server that hosts the API and&amp;nbsp;&lt;A href="https://internal-server.com/4.x/esri/views/MapView.js" style="color: #2989c5; text-decoration: none;"&gt;https://internal-server.com/4.x/esri/views/MapView.js&lt;/A&gt;, along with the other&amp;nbsp;scripts do exist. It's just that esri-loader doesn't seem to set the base URL. I've been following this documentation (&lt;A class="link-titled" href="https://www.npmjs.com/package/esri-loader" title="https://www.npmjs.com/package/esri-loader"&gt;esri-loader - npm&lt;/A&gt;), but having zero luck. I even tried passing a dojoConfig option with a baseUrl, property, but that didn't seem to help. Please help. Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 12:15:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/use-arcgis-api-from-another-host-server-using-esri/m-p/398360#M36691</guid>
      <dc:creator>SalvadorFiesta</dc:creator>
      <dc:date>2020-09-15T12:15:11Z</dc:date>
    </item>
  </channel>
</rss>

