AGOL update has broken custom apps built with WAB 1.1

3819
6
Jump to solution
07-14-2015 11:15 AM
GeorgeOulton1
New Contributor III

Apps built using WAB 1.1 (Dev Edition) that consume web maps containing labelled features completely break during the labellayer function of the api.

I removed labels from the features in the map and everything is back to smooth sailing. Has anyone else seen this? The error is below.

TypeError: Unable to draw graphic (null): Cannot read property 'dateFormat' of null
    at G._convertOptions (https://js.arcgis.com/3.13/esri/layers/LabelLayer.js:58:402)
    at G.refresh (https://js.arcgis.com/3.13/esri/layers/LabelLayer.js:49:346)
    at g.hitch (https://js.arcgis.com/3.13/init.js:177:296)
    at null.<anonymous> (https://js.arcgis.com/3.13/init.js:177:241)
    at p._onArr2Obj (https://js.arcgis.com/3.13/init.js:1191:365)
    at g.(anonymous function).h [as onUpdateEnd] (https://js.arcgis.com/3.13/init.js:244:117)
    at p._fireUpdateEnd (https://js.arcgis.com/3.13/init.js:1806:166)
    at p._endCheck (https://js.arcgis.com/3.13/init.js:428:213)
    at p._drawFeatures (https://js.arcgis.com/3.13/init.js:427:261)
    at https://js.arcgis.com/3.13/init.js:426:114 "TypeError: Unable to draw graphic (null): Cannot read property 'dateFormat' of null
    at G._convertOptions (https://js.arcgis.com/3.13/esri/layers/LabelLayer.js:58:402)
    at G.refresh (https://js.arcgis.com/3.13/esri/layers/LabelLayer.js:49:346)
    at g.hitch (https://js.arcgis.com/3.13/init.js:177:296)
    at null.<anonymous> (https://js.arcgis.com/3.13/init.js:177:241)
    at p._onArr2Obj (https://js.arcgis.com/3.13/init.js:1191:365)
    at g.(anonymous function).h [as onUpdateEnd] (https://js.arcgis.com/3.13/init.js:244:117)
    at p._fireUpdateEnd (https://js.arcgis.com/3.13/init.js:1806:166)
    at p._endCheck (https://js.arcgis.com/3.13/init.js:428:213)
    at p._drawFeatures (https://js.arcgis.com/3.13/init.js:427:261)
    at https://js.arcgis.com/3.13/init.js:426:114"
1 Solution

Accepted Solutions
XiaodongWang
Esri Contributor

This problem is caused by ArcGIS JS-API upgrade to js-api3.14 on AGOL3.8, but WAB develop edition 1.1 use js-api3.13, the issue will resolve automatically in WAB develop edition 1.2(release in early August).

As a temporary resolution, use &apiurl=//js.arcgis.com/3.14  query parameter to access WAB develop edition 1.1, for example:

http://localhost:3344/webappbuilder/?id=5&apiurl=//js.arcgis.com/3.14

View solution in original post

6 Replies
AdamInglis
Occasional Contributor II

I'm having the same issue.

0 Kudos
AndrewMurdoch
Occasional Contributor

And here as well.  Using WAB 1.1 developer edition code as well.  Though we think the issue is more of an AGOL webmap issue with labeling that arrived with the new updates to AGOL recently.  We have an open issue with ESRI on this one and their tech was able to replicate the issue (with our AGOL data / webmap using JSAPI only).

If we get a resolution, I'll post that here.

DanBrellis
New Contributor

I'm experiencing the same issue. Any update on a fix for this? Is there another thread going on that I can monitor for information? Thanks!

0 Kudos
XiaodongWang
Esri Contributor

This problem is caused by ArcGIS JS-API upgrade to js-api3.14 on AGOL3.8, but WAB develop edition 1.1 use js-api3.13, the issue will resolve automatically in WAB develop edition 1.2(release in early August).

As a temporary resolution, use &apiurl=//js.arcgis.com/3.14  query parameter to access WAB develop edition 1.1, for example:

http://localhost:3344/webappbuilder/?id=5&apiurl=//js.arcgis.com/3.14

AndrewMurdoch
Occasional Contributor

What are the implications of modifying existing deployed sites' env.js files to point to the new 3.14 version of the JSAPI?

In the WAB env.js file, these lines appear to control the JSAPI version used throughout the WAB application:

//////Replace the following line with the jsapi you prefer
after download the app,
  //////including the comment
 
  apiUrl = "//js.arcgis.com/3.14";
 
  //////////////////////////////////////////////////////////////
  allCookies = getAllCookies();
  window.isRunInPortal = !isXT;
  if (!apiUrl) {
    if (queryObject.apiurl) {
      apiUrl = queryObject.apiurl;
    } else if (isXT) {
      apiUrl = '//js.arcgis.com/3.14';
    } else {
      var portalUrl = getPortalUrlFromLocation();
      if (portalUrl.indexOf('arcgis.com') > -1) {
        apiUrl = '//js.arcgis.com/3.14';
      } else {
        apiUrl = portalUrl + 'jsapi/jsapi/';
      }
    }
}


0 Kudos
XiaodongWang
Esri Contributor

Just need to change the line#5.

2-1.png