8 months ago
Project ID(Serivice ID)=>cf9f679d-d447-49bc-be99-0c5cb235f2bc
Project Name(Serivce Name)=>glistening-analysis
My railway.json
{
"$schema": "https://railway.app/railway.schema.json",
"name": "WiddyUP2.0 Monorepo",
"description": "Student Fundraising Platform Monorepo Deployment",
"monorepo": {
"root_directory": "./",
"detect_package_manager": true,
"services": [
{
"name": "WiddyUP tRPC backend API",
"path": "packages/backend",
"buildCommand": "pnpm run build",
"startCommand": "pnpm dev",
"dependsOn": [],
"environment": {
"PORT": "3001"
}
},
{
"name": "WiddyUP Frontend (using mobile app to represent)",
"path": "apps/mobile",
"buildCommand": "pnpm --filter mobile build",
"startCommand": "pnpm --filter mobile dev",
"dependsOn": ["WiddyUP tRPC backend API"],
"environment": {
"EXPO_PUBLIC_API_URL": "${{services[\"WiddyUP tRPC backend API\"].url}}"
}
}
]
},
"build_environment": {
"NODE_VERSION": "22.x"
}
}I deployed a Turborepo project (Node.js with TypeScript) and encountered an issue. even I use the gitlab is not work.Please give us some help.
Attachments
6 Replies
8 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!
8 months ago
Heyy, I think this fails because railway doesn’t know which subdirectory or command to use per service in the monorepo and it's likely defaulting to the root without proper build/start configuration.
8 months ago
To solve this, i think you should create a seperate railway service for each app in your monrepo. And in each of the service settings set the root directory(e.g. packages/backend, apps/mobile), the build command (e.g., pnpm --filter backend build) and the start command (e.g., pnpm --filter backend dev).
You can also add a helper script in your package.json like :
"build:backend": "pnpm --filter backend build",
"start:backend": "pnpm --filter backend dev"
idiegea21
To solve this, i think you should create a seperate railway service for each app in your monrepo. And in each of the service settings set the root directory(e.g. packages/backend, apps/mobile), the build command (e.g., pnpm --filter backend build) and the start command (e.g., pnpm --filter backend dev).You can also add a helper script in your package.json like :"build:backend": "pnpm --filter backend build", "start:backend": "pnpm --filter backend dev"
8 months ago
I already have the help script. seems like your previous message more helpful.
Railway
Hey there! We've found the following might help you get unblocked faster: - [🧵 Include monorepo root in build environment](https://station.railway.com/questions/include-monorepo-root-in-build-environme-f7bae155) - [🧵 build failed](https://station.railway.com/questions/build-failed-129ef04f) - [🧵 Turborepo typescript apps - can't find /dist/index.js](https://station.railway.com/questions/turborepo-typescript-apps-can-t-find-19c292db) If you find the answer from one of these, please let us know by solving the thread!
8 months ago
How to setup up multiple repo with railway.json configuration, any resource or docs with railway? I have not see it.