R
Railway•10mo ago
tabu

useSWR different behavior on railway?

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
npm
swr
React Hooks library for remote data fetching. Latest version: 2.2.1, last published: 7 days ago. Start using swr in your project by running npm i swr. There are 964 other projects in the npm registry using swr.
Solution:
is VITE_SERVER_ENDPOINT defined? are all your env variables defined?
Jump to solution
8 Replies
Percy
Percy•10mo ago
Project ID: 09b9adb2-6a8b-4acd-81be-470217717e55
tabu
tabu•10mo ago
09b9adb2-6a8b-4acd-81be-470217717e55 update: does the same thing on tanStack 😭 pls help
tabu
tabu•10mo ago
Brody
Brody•10mo ago
please share your repo
tabu
tabu•10mo ago
GitHub
GitHub - TabuHana/Store-CMS-TS: A fully typed CMS store built with ...
A fully typed CMS store built with small businesses. Track your orders, customers and products with ease! - GitHub - TabuHana/Store-CMS-TS: A fully typed CMS store built with small businesses. Trac...
tabu
tabu•10mo ago
the issue is in client/src/pages/dashboard.tsx
Solution
sixfalls
sixfalls•10mo ago
is VITE_SERVER_ENDPOINT defined? are all your env variables defined?
tabu
tabu•10mo ago
I think that might be my issue, I didnt configure it correctly on the frontend dead 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 I think thats, my issue. Still trying to figure out how to do it, but tyvm !