useEffect issues, nextJS app
I have a useEffect hook to call from a redis database, but it doesn't trigger, even on page load. It works fine on localhost, but breaks when I deploy to railway. Is this a common issue?
9 Replies
Project ID:
e005bbf6-c2e1-4759-b9bd-b3d4e57c9f10
e005bbf6-c2e1-4759-b9bd-b3d4e57c9f10
did the connection to the redis database fail?
It seems like it's something to do with react's rendering, I get errors that seem to stem from "Text content does not match server-rendered HTML.
"
have you tried researching this issue?
I'm looking into it right now, seems like more of a react thing than a railway thing, I'm realizing
It's a bit confusing why it works fine on localhost but not on deploy tho
you took the words out of my keyboard
this issue would for sure not be isolated to railway
I don't know web dev too well, but I think I solved the issue? I had a useEffect hook tracking some variable state, and once the hook triggered, it would call an API I wrote via GET. But after messing around with it and changing it to POST, everything seems to work fine? I'm not sure if there's some major difference between get and post I don't know of or if there's something going on with Railway on that regard, but I'm happy it's done
odd, but glad you got it solved!