Change WAB JS API Version

642
3
05-06-2020 06:52 PM
JordanHahn1
New Contributor

I'm currently developing in WAB v2.15.  I'm trying to use JS API v4.14 instead of the default v3.31.  I followed the instructions here; however, after changing the apiVersion to 4.14 (either by un-commenting the "apiUrl = 'https://js.arcgis.com/4.14'" line or changing the apiVersion variable to 4.14) within the env.js file I cannot get WAB to load.  When inspecting the code, I see I am receiving the following error: "GET https://js.arcgis.com/4.14/esri/XXXXX.js net::ERR_ABORTED 404".

What am I doing wrong?

0 Kudos
3 Replies
mdonnelly
Esri Contributor

I'm not sure you can choose to use just version 4 of the Javascript API for WAB.

Version 4 of the JS API is markedly different from version 3 and requires different code to support it. If you look at the following link it shows that WAB uses v4 for 3D but v3 for 2D:

About release versions—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers 

The link you are referencing is for changing the site of the JS API CDN. For instance, you may host the CDN yourself or choose one that is in a closer locale to your application.

Regards,
Mark
JordanHahn1
New Contributor

Mark - thanks for the reply.

I must have looked at the table a dozen times yesterday and missed the fact that each app type (2D vs 3D) is the differentiating factor between the JS API versions.  Again, thanks for pointing that out.

In further troubleshooting it last night I started to notice I was only receiving 404 errors for modules that had changed between v3 and v4.  For example, I was receiving the error for the IdentityManager module.  Once I did a find all / replace and updated the path to the new esri/identitiy/IdentityManager path (vice the original esri/IdentityManager path), the error went away.  Not sure what side impacts this has "under the hood" though.

As I'm working on a 2D app, looks like I will have to roll back to v3.31 of JS API.  I'd be curious if Esri plans to change the WAB baseline completely over to v4.

0 Kudos
KenBuja
MVP Esteemed Contributor

Esri doesn't have any plans to upgrade the 2D apps to 4.x in WAB.  Experience Builder is the new way of creating apps, fully embracing 4.x.

0 Kudos