evancz / elm-architecture-tutorial

How to create modular Elm code that scales nicely with your app
https://guide.elm-lang.org/
BSD 3-Clause "New" or "Revised" License
4.17k stars 738 forks source link

CORS error in 05-http.elm #136

Open sbfram opened 5 years ago

sbfram commented 5 years ago

Hi,

There's a CORS issue when running the 05-http.elm example in the tutorial. Chrome tells me

Access to XMLHttpRequest at 'https://elm-lang.org/assets/public-opinion.txt' from origin 'null' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://worker.elm-lang.org' that is not equal to the supplied origin.

I changed the example to request a file from a server that I could configure with Access-Control-Allow-Origin : * and that worked. Thought I'd post this here so that other Elm beginners who Google the error will understand that it's not a bug in the example per se, but appears to be a configuration issue on the server side.

Thanks, Steve