ParasolJS / parasol-es

ES6 module for interactive visualization of multi-objective optimization problems
https://parasoljs.github.io/
MIT License
26 stars 5 forks source link

Fetch API fails to load local datasets for Chrome #27

Closed wraseman closed 5 years ago

wraseman commented 5 years ago

The Fetch API (which imports data) cannot import local data, it must be hosted on a server. See this StackOverflow exchange. Specifically, this seems to be an error for Chrome browsers. Based on my understanding of the problem, it shouldn't be an issue once Parasol apps and their data are hosted online--although I do need to test this assumption. Regardless, this is a real pain for developing apps offline and completing the tutorials.

I think I've come up with a work-around for now. I'm going to host csv files on Open Science Framework. This will give each file a unique URL, and we can just call the data from there instead of doing it locally. If users want to work entirely offline, they would need to use Firefox, Edge, or other non-Chrome browsers and change the filepath to something local.

I'll upload the datasets to the following URL in a repository called Parasol Datasets: https://osf.io/57a8m/

wraseman commented 5 years ago

After testing the above solution, this won't work. I've tried getting the data from both OSF and Google Sheets but I get the following CORS issue: StackOverflow forum. Since there doesn't seem to be a good way to Fetch the data without creating a proxy URL that I can see, I will add a tutorial for how Chrome users can make this work by using npm.

wraseman commented 5 years ago

Nevermind... this seems to be a symptom of a larger issue. There seem to be differences between developing Parasol apps locally vs. hosting them on the web (or using npm run dev to create a proxy server). The main ones are this Fetch API issue and that the parasol.standalone.js paths need to be different. @joshhjacobson, we probably need to meet whenever you are free to figure out how to address this, so we can get the tutorials up and running. The most brute force way would be to make people download npm and follow the Parasol Development instructions.

wraseman commented 5 years ago

This issue is resolved if we just run the Parasol applications on an internal server (or localhost). This seems like the best way to develop apps, so I'm going to close this issue.