Vite + React getting 404 on routes
mooyg
HOBBYOP

2 years ago

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

24 Replies

mooyg
HOBBYOP

2 years ago

b4cf33da-774b-4cf4-a5dd-c6f6987fe0cd


mooyg
HOBBYOP

2 years ago

It's using CSR


mooyg
HOBBYOP

2 years ago

is there anyway to redirect?


brody
EMPLOYEE

2 years ago

please share a link so we can experience this



brody
EMPLOYEE

2 years ago

was this link not supposed to work for me?


mooyg
HOBBYOP

2 years ago

it wass



mooyg
HOBBYOP

2 years ago

this doens't


mooyg
HOBBYOP

2 years ago

csr routing btw


brody
EMPLOYEE

2 years ago

how are you serving the built static site?


mooyg
HOBBYOP

2 years ago

using http-server


mooyg
HOBBYOP

2 years ago

npx http-server dist


brody
EMPLOYEE

2 years ago

well that explains it


brody
EMPLOYEE

2 years ago

copy the nixpacks.toml and Caddyfile from this repo into your project


mooyg
HOBBYOP

2 years ago

same issue still


mooyg
HOBBYOP

2 years ago

returns application failed to respond now


mooyg
HOBBYOP

2 years ago

with this error


brody
EMPLOYEE

2 years ago

can you share your repo


mooyg
HOBBYOP

2 years ago

/bin/bash: npm: command not found


brody
EMPLOYEE

2 years ago

please remove any start command you may have set, like in the service settings


mooyg
HOBBYOP

2 years ago

O okay


mooyg
HOBBYOP

2 years ago

worked thank you


brody
EMPLOYEE

2 years ago

no problem


Loading...