#useSWR different behavior on railway?

14 messages · Page 1 of 1 (latest)

clear dew
#

Hi I'm using useSWR hook on my react app frontend and instead of sending back the data the same way it is in development, its returning the entire HTML page instead. I do think I'm using server side rendering at all. Any ideas whats happening?
package in question -> https://www.npmjs.com/package/swr

expected from data -> the user's data
getting -> HTML(?)

sorry if this is a dumb question, I'm a self taught
junior developer

lapis muralBOT
#

Project ID: 09b9adb2-6a8b-4acd-81be-470217717e55

undone kestrelBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

clear dew
clear dew
#

update: does the same thing on tanStack 😭

#

pls help

open stratus
#

please share your repo

clear dew
#

the issue is in client/src/pages/dashboard.tsx

oblique turret
#

is VITE_SERVER_ENDPOINT defined? are all your env variables defined?

clear dew
#

I think that might be my issue, I didnt configure it correctly on the frontend dead

#

I dont understand the docs for exposing the port, I have it set to 0.0.0.0:$PORT but thats not changing to the correct port

clear dew
#

I think thats, my issue. Still trying to figure out how to do it, but tyvm !