PokeMate / frontend

UI for interacting the PokeMate application
1 stars 0 forks source link

Endless loading loop #32

Closed Lochindaal closed 4 years ago

Lochindaal commented 4 years ago

When loading a pokemon from the pokedex the UI just keeps loading.

The rest response works. This is the case for old and newly generated pokemons.

simibac commented 4 years ago

Do you get the following error message in the console?

Access to fetch at 'http://localhost:5100/v1/rating/2' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

simibac commented 4 years ago

This can be fixed with a proxy as explained here: https://www.telerik.com/blogs/dealing-with-cors-in-create-react-app

simibac commented 4 years ago

Was due to an missing annotation in the backend. See commit: https://github.com/PokeMate/backend/commit/327314ce3346fb8d69b5dc8948fc963f1d2fe5f8