5 months 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
.railwayignoreto avoid triggering CaddyTried various
nixpacks.tomlformatsAdded 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
cpstep to move Vite’s build output toserver/public/?Or can Railway's build phase be configured to detect and handle this automatically?
2 Replies
5 months 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!
5 months ago
Yep, your best bet is to copy vites build output to server/public. Shouldnt have any issues.