#react 404

28 messages · Page 1 of 1 (latest)

fervent surge
#

my react app works on local host and it works when deployed so if i click onto one of the pages it works but if i refresh that page it just breaks and sends a 404 also if i where to search example.com/faq i will be shown 404 as well

tame meadowBOT
#

Project ID: N/A

solid vapor
#

please share your repo

hallow ridge
#

classic: no redirect is set up for client side routing

solid vapor
#

theres something odd going on though, if they where using a dev server the /fag page would work

hallow ridge
#

doesn't a static "thingy" on railway need it to be configured separately?

#

if I just build a vite+react project and put it as is it would behave the same

solid vapor
#

if you uploaded just the build folder yes

hallow ridge
#

well they didn't say "a next app" so I assume a static build

#

ok not gonna argue

solid vapor
#

yeah but they are likely uploading the entire project folder, package.json and all. theres too many unknowns, thats why i asked for the repo

fervent surge
#

Sorry I just went out for food so I’m afk but I’m not using vite and I just pulled the build into its own repo and then deployed that

solid vapor
#

create react app?

fervent surge
#

Yep

solid vapor
fervent surge
#

The reason I pulled the build folder was when I deployed it, the react dev tools was red meaning that it wasn’t correct and the usage was crazy

solid vapor
#

because you where running a development server

fervent surge
#

Yh how do I not do that😂😂

solid vapor
#

see my message above

solid vapor
#

yeah, read the readme for further info

fervent surge
#

Thank you will try when I get back

fervent surge
#

brody you the goat, 3 months ago i had my head spun because i was just uploading my full repo and it took 2 days & 3 compsi students to figuire out how to deploy a react app that didn't have stupid usage and i just spent the whole day looking at other people's tickets in the help section and this literally worked first time no problems

solid vapor
#

happy i could help

#

railway is not like vercel, railway runs your code as is and uses the default start script, if the start script starts a development server, then a development server is what will be ran

fervent surge
solid vapor
#

neither create react app or vite come with production ready web servers, thats where caddy comes into play. as mentioned railway is not like vercel so we have to setup the web server ourselves (caddy)

but i have never built a site with react or any framework for that matter, so im no help with that side of things, i only know how to deploy them

fervent surge