14 days ago
Expected Behavior:
The full-stack Vite + Express app should serve both API and frontend from the same deployment.
Actual Behavior:
Build completes with no errors
Node server starts normally (
node dist/index.js
)API routes return JSON as expected
Frontend renders blank white page (no 404s, just empty content)
Root Cause :
Static assets built into dist/public/
aren't accessible at runtime. Express looks for them in server/public/
, leading to missing index.html
and a blank screen.
Attempted Fixes:
Updated
.railwayignore
to avoid triggering CaddyTried various
nixpacks.toml
formatsAdded Procfile (ignored by Nixpacks)
Set providers explicitly
Debugged with logging and build commands
Ask for Railway Support:
Is there a recommended way to handle this file mismatch?
Should we add a custom
cp
step to move Vite’s build output toserver/public/
?Or can Railway's build phase be configured to detect and handle this automatically?
2 Replies
14 days ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
14 days ago
Yep, your best bet is to copy vites build output to server/public. Shouldnt have any issues.