R
Railway6mo ago
acronie

Vite + React getting 404 on routes

Hey I am getting 404 on routes if I am not visiting them from within the app. But if I start with / and visit further it works
Solution:
https://github.com/brody192/vite-react-template copy the nixpacks.toml and Caddyfile from this repo into your project...
Jump to solution
16 Replies
Percy
Percy6mo ago
Project ID: b4cf33da-774b-4cf4-a5dd-c6f6987fe0cd
acronie
acronieOP6mo ago
b4cf33da-774b-4cf4-a5dd-c6f6987fe0cd It's using CSR is there anyway to redirect?
Brody
Brody6mo ago
please share a link so we can experience this
Brody
Brody6mo ago
was this link not supposed to work for me?
acronie
acronieOP6mo ago
it wass https://college-home.up.railway.app/home this doens't csr routing btw
Brody
Brody6mo ago
how are you serving the built static site?
acronie
acronieOP6mo ago
using http-server npx http-server dist
Brody
Brody6mo ago
well that explains it
Solution
Brody
Brody6mo ago
https://github.com/brody192/vite-react-template copy the nixpacks.toml and Caddyfile from this repo into your project
acronie
acronieOP6mo ago
same issue still returns application failed to respond now with this error
Brody
Brody6mo ago
can you share your repo
acronie
acronieOP6mo ago
/bin/bash: npm: command not found
Brody
Brody6mo ago
please remove any start command you may have set, like in the service settings
acronie
acronieOP6mo ago
O okay worked thank you
Brody
Brody6mo ago
no problem
Want results from more Discord servers?
Add your server