R
Railway•3mo ago
Radu Dascalu

Custom build script crashing

Failing to build my monorepo project with a custom build script (was working fine with the defaults). My monorepo has only one app at /apps/web-app (which I set up as the Root Dir on Railway). I have a Postgres service running as well, and I need to run the migrations from my monorepo there, so I added a custom script in my web-app/package.json (see 1st screenshot), then added my custom build command (see 2nd screenshot) but it's crashing the build
No description
No description
24 Replies
Percy
Percy•3mo ago
Project ID: 75979406-ee6e-4e85-858d-b7841574de4c
Radu Dascalu
Radu Dascalu•3mo ago
75979406-ee6e-4e85-858d-b7841574de4c
Radu Dascalu
Radu Dascalu•3mo ago
I also have a monorepo level build command and have already tried it but didn't have any success
No description
Brody
Brody•3mo ago
it's very hard to help with your issue when we aren't told the issue, please provide your build logs with this https://bookmarklets.up.railway.app/log-downloader/
Radu Dascalu
Radu Dascalu•3mo ago
Apologies, hope this helps
Radu Dascalu
Radu Dascalu•3mo ago
I've been trying to solve the issue for the past 20 min or so but I'm hoping the bookmark extracted the correct logs
Radu Dascalu
Radu Dascalu•3mo ago
I've managed to get it running like so
No description
Brody
Brody•3mo ago
now you mentioned you currently only have one app in this monorepo, I'm assuming at some point you will add another app?
Radu Dascalu
Radu Dascalu•3mo ago
Sadly any mention of pnpm would break the build process Yes you're right, at some point I will have more apps
Brody
Brody•3mo ago
will they import packages from one another?
Radu Dascalu
Radu Dascalu•3mo ago
Yes most likely
Brody
Brody•3mo ago
then you can't set a root directory because only the set directory will be copied in meaning you can't import anything from the other packages because they won't be in the image so please set the root directory back to the root and set your applicable build and start commands that are filtered to run the build and start commands of your web-app
Radu Dascalu
Radu Dascalu•3mo ago
Sure, trying that now But I don't understand why that would be an issue now since I only have one app
Radu Dascalu
Radu Dascalu•3mo ago
Also, for the Custom Build & Deploy command, do I use npm or can I use pnpm?
No description
Brody
Brody•3mo ago
you're right it wouldn't the issue right now, but it sure will be when you add more apps to the monorepo, so I believe it's best to start off with the correct setup npm or pnpm depends on what you use locally
Radu Dascalu
Radu Dascalu•3mo ago
It is failing again 😦
Radu Dascalu
Radu Dascalu•3mo ago
Will try to run it with pnpm instead of npm run
Radu Dascalu
Radu Dascalu•3mo ago
Trying it out like so
No description
No description
Radu Dascalu
Radu Dascalu•3mo ago
The prev build had the same scripts in the root package.json, the only difference was that the custom build & start commands were using npm run instead of pnpm
Radu Dascalu
Radu Dascalu•3mo ago
Radu Dascalu
Radu Dascalu•3mo ago
Oops gimme 2 sec, just realised I had forgotten to push my changes after committing Looks like its working now, sorry for the stupid mistakes And thank you for your time. Your suggestion about the monorepo setup is what fixed it I think
Brody
Brody•3mo ago
awesome and now the railway side of things is setup correctly too probably a bit of both
Radu Dascalu
Radu Dascalu•3mo ago
Well, I'm all happy now that it works so your input is very much appreciated
Brody
Brody•3mo ago
happy to help!
Want results from more Discord servers?
Add your server
More Posts
Blue/Green Deployment - Traffic To New Deployments DelayedHi Railway, Today we did a deployment at around 8:12AM UTC, all of the services that are deployed sTaking back-up of postgres databaseHey — I'm trying to back-up a postgres db from my Railway project to my Mac. I found this guide: httRestoring the pg_dump from the postgres-s3-backups toolWe have a bunch of database dumps via this tool: https://github.com/railwayapp-templates/postgres-s3We're getting too many database connections and need to scale - what options are available?db is locking due to too many connections. do I have options within railway to scale?Need help with Timezones jsRailway is hosted somewhere else so the Date.now() is showing for somewhere else, how can I fix thisPrivate URL not working (public URL works fine)I've spun a new database service inside my project to run a libSQL database (https://github.com/tursProblems getting images and displaying console.log() on a Railway deploymentA request is made from the client to the server to obtain articles. In the Visual Studio Code deployPath to the TLS keystore file not defined.`Path to the TLS keystore file not defined. Please set the KEYCLOAK_HTTPS_KEY_STORE_FILE variable toDid railway block Nigerian IP addresses from accessing their site?This has been going on for about a week now, i can’t the railway site from Nigeria unless I use a vGetting "Layer already exists" for project built with dockerMy Docker image is working as expected locally, but it seems to be stuck on an older version on Rail