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
Percy
Percy17mo ago
Project ID: e005bbf6-c2e1-4759-b9bd-b3d4e57c9f10
meinsweper
meinsweperOP17mo ago
e005bbf6-c2e1-4759-b9bd-b3d4e57c9f10
Brody
Brody17mo ago
did the connection to the redis database fail?
meinsweper
meinsweperOP17mo ago
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. "
Brody
Brody17mo ago
have you tried researching this issue?
meinsweper
meinsweperOP17mo ago
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
Brody
Brody17mo ago
you took the words out of my keyboard this issue would for sure not be isolated to railway
meinsweper
meinsweperOP17mo ago
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
Brody
Brody17mo ago
odd, but glad you got it solved!
Want results from more Discord servers?
Add your server