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
24 Replies
Project ID:
75979406-ee6e-4e85-858d-b7841574de4c
75979406-ee6e-4e85-858d-b7841574de4c
I also have a monorepo level build command and have already tried it but didn't have any success
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/
Apologies, hope this helps
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
I've managed to get it running like so
now you mentioned you currently only have one app in this monorepo, I'm assuming at some point you will add another app?
Sadly any mention of pnpm would break the build process
Yes you're right, at some point I will have more apps
will they import packages from one another?
Yes most likely
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
Sure, trying that now
But I don't understand why that would be an issue now since I only have one app
Also, for the Custom Build & Deploy command, do I use npm or can I use pnpm?
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
It is failing again 😦
Will try to run it with pnpm instead of
npm run
Trying it out like so
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
Failed again
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
awesome and now the railway side of things is setup correctly too
probably a bit of both
Well, I'm all happy now that it works so your input is very much appreciated
happy to help!