HSZemi / mahlowat

mahlowat ist die Implementierung eines Wahlpositionsvergleichswerkzeugs.
MIT License
59 stars 30 forks source link

error on masterfile #8

Closed dafwb closed 4 years ago

dafwb commented 4 years ago

Hello, I cloned the repository to my ubuntu 18.04 machine and opened the index.html with firefox and got the message: "Fehler Die Konfigurationsdatei config/data.json konnte nicht geladen werden. Existiert sie und enthält keine Syntaxfehler?" I am a bit confused, because i didn't changed data.json at all. Also after using generator.html and and checking with 'file -i config/data.json' the char-set, I got the same error message. Do you have any explanation for this issue? best regards Daniel

HSZemi commented 4 years ago

Hi Daniel!

If you open the developer tools by pressing Ctrl+Shift+I and select the Console tab, you should see a message along the lines of:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:////mahlowat/config/data.json. (Reason: CORS request not http).

or:

Access to XMLHttpRequest at 'file:////mahlowat/config/data.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

This issue only appears due to you opening the file directly instead of viewing it from a web server.

For local testing, you can spin up a local web server in the mahlowat directory by running either of the following commands, depending on what is available on your system:

You should then be able to access a working mahlowat at http://localhost:8000

dafwb commented 4 years ago

Thank you very much, now local testing is possible!