Widget.js Network Calls- Now appended with ?wab_dv=..

231
5
Jump to solution
09-24-2018 09:41 PM
TimothyBarnes
Occasional Contributor

We have a custom search widget which calls additional libraries in its widget.js using jimu/loaderplugins to load jQuery and terraformer.

Looking at the network calls when the app is initiating the widgets in an older WAB dev edition app (v1.3) compared with a newer one (v2.5), the calls to Widget.js have now been appended with ?wab_dev=2.5 (i.e. the deployVersion as listed in the env.js of the application).

This is causing issues with the loading of these extra libraries (access is denied and the widget fails to startup). Commenting out the deployVersion line in env.js throws an error.

Is there a way to disable that? Or alternatively, is there a updated method for loading additional libraries (in order) from the widget?

Regards

0 Kudos
1 Solution

Accepted Solutions
TimothyBarnes
Occasional Contributor

That part worked (i.e. removed the deploy version from the outgoing calls) but didn't resolve loading of the 3rd party libraries.

I've subsequently traced the error to version 3.23 of the JS API. Reverting env.js to point to version 3.20 of the API removes all errors- We host our API locally so I'm unsure if it is a bad install of 3.23 or something in version 3.23 generally.

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

NZ GeoCAD,

   The deploy version is added to the url in the env.js appendDeployversion function. Just comment out 5-9.

function appendDeployVersion(url){
    if(/^http(s)?:\/\//.test(url) || /^\/proxy\.js/.test(url) || /^\/\//.test(url)){
      return url;
    }
    // if(url.indexOf('?') > -1){
    //   url = url + '&wab_dv=' + deployVersion;
    // }else{
    //   url = url + '?wab_dv=' + deployVersion;
    // }
    return url;
  }
TimothyBarnes
Occasional Contributor

Thanks Robert- That helped, but didn't solve my problem unfortunately. I think its related to how the external libraries are loaded with jimu/loaderplugins so will keep searching.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

So your saying the deploy version is still getting added to your third part libraries?

0 Kudos
TimothyBarnes
Occasional Contributor

That part worked (i.e. removed the deploy version from the outgoing calls) but didn't resolve loading of the 3rd party libraries.

I've subsequently traced the error to version 3.23 of the JS API. Reverting env.js to point to version 3.20 of the API removes all errors- We host our API locally so I'm unsure if it is a bad install of 3.23 or something in version 3.23 generally.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

OK. Don't forget to mark this as answered.

0 Kudos