20 days ago
How do I go about doing this?
Can't find a good example and need to be pointed in the right direction.
Folder structure is:
app/
frontend/
src/
main.tsx
index.html
package.json
server/
index.ts
package.json (of the server)
tesconfig.json (of the server
4 Replies
20 days ago
Create two services from the same repo and set the root directory to frontend/ for one and server/ for the other in each service's settings. Our monorepo deployment guide covers the full setup including watch paths to prevent unnecessary rebuilds.
Status changed to Awaiting User Response Railway • 20 days ago
sam-a
Create two services from the same repo and set the root directory to frontend/ for one and server/ for the other in each service's settings. Our monorepo deployment guide covers the full setup including watch paths to prevent unnecessary rebuilds.
20 days ago
Hi sam, yes this is the current setup.The run script for my server is in the root. That builds fine. This issue is with the frontend where I get an error of:
vite v7.3.1 building client environment for production...
transforming...
✓ 1966 modules transformed.
✗ Build failed in 2.03s
error during build:
undefined
error: script "build" exited with code 1
ERROR: failed to build: failed to solve: process "sh -c bun run build" did not complete successfully: exit code: 1
I have set it to frontend and fixed the build command to be the correct bun run build, but no luck.
Status changed to Awaiting Railway Response Railway • 20 days ago
20 days ago
The "undefined" error during Vite build is typically a configuration issue in your project. Railpack needs a bun.lock file present in the frontend/ directory to properly detect Bun as the package manager - without it, the build may not install dependencies correctly.
BTW, this is application-level build configuration which falls outside our support scope (but thought I would try to help). If you're still stuck after checking the lockfile, let us know and we can route this to our community bounty program where someone can help debug your specific setup.
Status changed to Awaiting User Response Railway • 20 days ago
Status changed to Solved sam-a • 20 days ago
sam-a
The "undefined" error during Vite build is typically a configuration issue in your project. Railpack needs a `bun.lock` file present in the `frontend/` directory to properly detect Bun as the package manager - without it, the build may not install dependencies correctly. BTW, this is application-level build configuration which falls outside our support scope (but thought I would try to help). If you're still stuck after checking the lockfile, let us know and we can route this to our community bounty program where someone can help debug your specific setup.
20 days ago
Appreciate you going outside the scope. I checked - I do have a bun.lock file present in the frontend, tried to get my backend to then serve the static files after building the frontend as it could deploy. However, despite the build working none of the backend routes work on the url. How can I get some help from community?
Status changed to Awaiting Railway Response Railway • 20 days ago