Select to view content in your preferred language

Upgrading from Javascript Maps SDK 4.24 to 4.26.

809
5
04-20-2023 08:59 AM
YangCao
Emerging Contributor

Currently, I am developing a web GIS app in a .Net C# project using ArcGIS Maps SDK for JavaScript 4.24. I am interested in trying out the new "highlightIds" feature for the FeatureTable, which was introduced in ArcGIS Maps SDK for JavaScript 4.25. However, when I attempted to replace the relevant code in the source code (replace <link rel="stylesheet" href="https://js.arcgis.com/4.24/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.24/"></script> with <link rel="stylesheet" href="https://js.arcgis.com/4.26/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.26/"></script>), the app failed to load and returned errors (as shown in the attached image) indicating that certain online resources could not be found (404 Not Found Error). For example, while "https://js.arcgis.com/4.24/dojo/dojo.js" loaded without issue, "https://js.arcgis.com/4.26/dojo/dojo.js" was not found.

CaptureAPIError.PNG

0 Kudos
5 Replies
RaymondHuang_Sg
Occasional Contributor

I read from this https://developers.arcgis.com/javascript/latest/4.25/ that the CDN on js.arcgis.com will no longer host the following AMD packages for version 4.25 and later, and hence dojo.js not found is expected. 

I guess options now will be to either host it or reference it from one of the hosting CDN as suggested on dojo page: Download - Dojo Toolkit

Cheers

Cheers,
Raymond
YangCao
Emerging Contributor

Dear Raymond,

I wanted to express my gratitude for your response. I wasn't aware that Esri had discontinued hosting the CND for dojo since 4.25. I visited the Dojo website and incorporated the "<script src="//ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js"></script>" into the body tag of the HTML in the source code. After running the application, I discovered that while there were fewer errors, some still persisted.

CaptureAPIError2.PNG

 

0 Kudos
ViktoriaMagnis
Emerging Contributor

I am having the same issue trying to use ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js. Did you ever figure this out. 

0 Kudos
LaurenBoyd
Esri Contributor

You may need to make sure you're loading the 3rd party libraries first before the JS Maps SDK is loaded.

Lauren
0 Kudos
ViktoriaMagnis
Emerging Contributor

This what I have but now it's not finding the ArcGIS API JavaScript 

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js"></script>
<script src="https://js.arcgis.com/4.28/"></script>

I am getting these errors

ViktoriaMagnis_0-1698785501333.png

 

 

0 Kudos