You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loving this library so far! I wanted to ask about an issue I ran into.
in pages/home.js, I call const {data} = useSWR("/api/endpoints/endpoint1")
and it fetches data correctly. But when I try to run the same code in pages/folder/folder1.js, it always returns undefined. I tried making another useSWR call to another endpoint (/api/myendpoint) and that works in pages/folder/folder1.js, so I'm wondering if it's an issue with my API endpoint.
My fetcher is defined in context with so I don't think that's an issue.
I'm pretty confused, so any comments are appreciated, thanks!
Edit: I added some logging in /api/endpoints/endpoint1 and it seems like useSWR isn't even hitting the endpoint. I'm even more confused at this point
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Loving this library so far! I wanted to ask about an issue I ran into.
in pages/home.js, I call
const {data} = useSWR("/api/endpoints/endpoint1")
and it fetches data correctly. But when I try to run the same code in pages/folder/folder1.js, it always returns undefined. I tried making another useSWR call to another endpoint (/api/myendpoint) and that works in pages/folder/folder1.js, so I'm wondering if it's an issue with my API endpoint.
My fetcher is defined in context with so I don't think that's an issue.
I'm pretty confused, so any comments are appreciated, thanks!
Edit: I added some logging in /api/endpoints/endpoint1 and it seems like useSWR isn't even hitting the endpoint. I'm even more confused at this point
Beta Was this translation helpful? Give feedback.
All reactions