#Get serverside prop issue
1 messages · Page 1 of 1 (latest)
How does server side prop work?
server side prop fetch ***
Will it fix if i just make react fetch?
@slender tendon pls put a thread name that is meaningful
does the page load any content
or it infinetly loads with no content
Get serverside prop issue
infinitely loops, but i think has loaded home page before
when you click cabins page it infinitely loops
and ive drilled it down to get server side props
@slender tendon does your api endpoint respond?
when you send a request to the cabins endpoint from somewhere else do you get a response?
also does the cabins page load any content?
how to test?
send a request to the api from somewhere
it console logs data in api but not respond i dont think
are there any errors on the server?
no
@brave charm Btw he had previously bazillion script tags in _app.js fetching libraries from cdns like jquery (twice). It might be something with that also
but the rest of the pages work
@frank field i tested and no its to do with cabins
so the bazillion script don't have an effect
That code is trash but it works, i will change in future
i tried fetching /cabins which is the route
and 404
404?
Why is the first screenshot localhost:3000 then this one is localhost:9000?
also isn't it cabins/holiday?
process.env.NEXT_PUBLIC_REACT_APP_API_URL + "cabins/holiday"
does this not give 404 at least?
gSSP seems fine though
@slender tendon what if you comment out the fetch in useEffect in LongTermsDetails
try using something like SWR or fetch in a useEffect hook, get the data on the client if you can, that way the site loads faster.
that way will work though, just not the most optimal
I fixed it, I believe was a server issue however was freezing instead of showing error message which is weird