Platane / snk

🟩⬜ Generates a snake game from a github user contributions graph and output a screen capture as animated svg or gif
https://platane.github.io/snk
4.22k stars 1.03k forks source link

Interactive demo CORS failure #121

Closed kjkent closed 2 months ago

kjkent commented 2 months ago

The interactive demo pulls in the user's profile picture, but then fails with error :( on the page and this in the console:

Access to fetch at 'https://snk-one.vercel.app/api/github-user-contribution/kjkent' from origin 'https://platane.me' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://platane.github.io' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
6813e0ec53a4391ce255.js:1247 

GET https://snk-one.vercel.app/api/github-user-contribution/kjkent net::ERR_FAILED 200 (OK)
    onSubmit @ 6813e0ec53a4391ce255.js:1247
    (anonymous) @ 6813e0ec53a4391ce255.js:1057
6813e0ec53a4391ce255.js:1247 

Uncaught (in promise) TypeError: Failed to fetch
    at onSubmit (6813e0ec53a4391ce255.js:1247:23)
    at HTMLFormElement.<anonymous> (6813e0ec53a4391ce255.js:1057:9)
Platane commented 2 months ago

there was a CORS error indeed, I just fixed it thanks !