Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run demo locally #7

Closed
betim opened this issue Aug 8, 2017 · 4 comments
Closed

Trying to run demo locally #7

betim opened this issue Aug 8, 2017 · 4 comments
Labels

Comments

@betim
Copy link

betim commented Aug 8, 2017

Hi,

Not a JS dev here. I tried to run the main demo locally, but it fails to load config.js.

From what I can see, esri requires config.js to be publicly available right? If yes, is there a workaround this?

Cheers

@jwasilgeo
Copy link
Collaborator

This is a little hard to help debug without more info. The local demos should work okay. Did you download the entire repository and then try to run the main demo? Are you using a web server on your computer? (you do not want to navigate to the demo's index.html in your browser to a URL that looks like file://...)

@betim
Copy link
Author

betim commented Aug 8, 2017

Sorry, this is entirely my fault. I didn't clone the repo and try to run the main demo, but rather copied files one by one.

The problem was: it tried to load config.js from http://config.js/ -- that's why I was assuming that it is required from esri.

This now works, but I still have no idea how config.js is loaded.

Regards

@jwasilgeo
Copy link
Collaborator

No worries and glad you got it working. As for config.js, we instruct Dojo (what the Esri JSAPI is built on top of) to become aware of other JavaScript resources in addition to the modules that it comes with out of the box. In our demos, we inform it that we need to be able to reference some local js files like this:
https://github.com/sarahbellum/Canvas-Flowmap-Layer/blob/master/demos/main/index.html#L28-L41

@betim
Copy link
Author

betim commented Aug 8, 2017

This answers all my questions. Thanks

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

No branches or pull requests

2 participants