Closed tongene closed 3 months ago
Hi @tongene , thank you for reporting.
I have the wrong URL on the useSWR
that's why you will keep receiving 404 error.
If you get 401 most probably your API required your authentication.
I have implemented useSWR
so that I could fetch the fresh data client side.
If you remove the useSWR
and with some updates you could convert to a server component, feel free to update base on your need.
Ok. Thanks. You are right, the 401 went away after a few attempts to fix it.
This is a screenshot from the index page of the Pokemons client component. On the page which is a server component, the API call works correclty. Should the API in the Index component have this behaviour? It keeps returning a 404. In my case, when I try to fetch from supabase using the same functions, I actually get a 401 unauthorised error. Is there a reason an error pops up on the same component when calling an API?