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
Solved! Go to Solution.
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.
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;
}
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.
So your saying the deploy version is still getting added to your third part libraries?
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.
OK. Don't forget to mark this as answered.