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?
6 Replies
Project ID:
e7389864-de88-4ce6-bec6-ce42cb2f5e50
e7389864-de88-4ce6-bec6-ce42cb2f5e50
vite builds to a folder called
dist
not build
Solution
so the start command would be
serve dist -s -n -L -p $PORT
ok, thanks
It is working, thank you very much for your help
no problem!