R
Railway2y ago
lalqh

React router 404

Hi, I'm trying to get React Router to work in production, so I followed the documentation and changed my startup script as follows "scripts": { "start": "serve build -s -n -L -p $PORT", "dev": "vite", "build": "vite build", "preview": "vite preview" }, but when I use the page https://compactstudios.tech/ I keep getting error 404, how can I fix it?
Solution:
so the start command would be serve dist -s -n -L -p $PORT
Jump to solution
6 Replies
Percy
Percy2y ago
Project ID: e7389864-de88-4ce6-bec6-ce42cb2f5e50
lalqh
lalqhOP2y ago
e7389864-de88-4ce6-bec6-ce42cb2f5e50
Brody
Brody2y ago
vite builds to a folder called dist not build
Solution
Brody
Brody2y ago
so the start command would be serve dist -s -n -L -p $PORT
lalqh
lalqhOP2y ago
ok, thanks It is working, thank you very much for your help
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server