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.8 Replies
Project ID:
09b9adb2-6a8b-4acd-81be-470217717e55
09b9adb2-6a8b-4acd-81be-470217717e55
update: does the same thing on tanStack ðŸ˜
pls help
please share your repo
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...
the issue is in client/src/pages/dashboard.tsx
Solution
is VITE_SERVER_ENDPOINT defined? are all your env variables defined?
I think that might be my issue, I didnt configure it correctly on the frontend 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 !