InsideMeter (Node.js + React) deploys successfully on Railway but serves a blank page
samir-lal
PROOP
a year 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 Caddy - Tried various
nixpacks.tomlformats - Added 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
Railway
BOT
a year 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!
a year ago
Yep, your best bet is to copy vites build output to server/public. Shouldnt have any issues.