Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

loadScript should return a singleton promise, or DEFAUL_URL should be configurable library-wise #61

Closed
veonline opened this issue Nov 23, 2017 · 1 comment · Fixed by #66

Comments

@veonline
Copy link

I've a probelm in my vuejs app due to the async nature of loadScript and loadModules.
When i boot my vue app i bootstrap also the esri library with loadScript({ url: "https://js.arcgis.com/3.22/init.js"}) and in some of my vue components i load modules with something like loadModules(['esri/geometry/geometryEngine'])
If loadScript with the custom version of the library is not completed, loadModules is rejected.
The solution is to provide the same promise instance for every loadScript call or maybe provide a configurable DEFAULT_URL or seti it with the first call of loadScript.

@tomwayson
Copy link
Member

Thanks @veonline

This is the same problem that I mention in #51.

As mentioned in that issue, a work around for now is to pass the same options to loadModules(), so:

loadModules(['esri/geometry/geometryEngine'], { url: "https://js.arcgis.com/3.22/init.js"})

I've elevated the priority of these issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants