Custom build script crashing
Anonymous
TRIALOP

2 years ago

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

0 Replies

Anonymous
TRIALOP

2 years ago

75979406-ee6e-4e85-858d-b7841574de4c


Anonymous
TRIALOP

2 years ago

I also have a monorepo level build command and have already tried it but didn't have any success

1219587972702408700


brody
EMPLOYEE

2 years ago

it's very hard to help with your issue when we aren't told the issue, please provide your build logs with this


Anonymous
TRIALOP

2 years ago

Apologies, hope this helps

1219653063896469594


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago

I've managed to get it running like so

1219653405614801000


brody
EMPLOYEE

2 years ago

now you mentioned you currently only have one app in this monorepo, I'm assuming at some point you will add another app?


Anonymous
TRIALOP

2 years ago

Sadly any mention of pnpm would break the build process


Anonymous
TRIALOP

2 years ago

Yes you're right, at some point I will have more apps


brody
EMPLOYEE

2 years ago

will they import packages from one another?


Anonymous
TRIALOP

2 years ago

Yes most likely


brody
EMPLOYEE

2 years 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


brody
EMPLOYEE

2 years ago

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


Anonymous
TRIALOP

2 years ago

Sure, trying that now


Anonymous
TRIALOP

2 years ago

But I don't understand why that would be an issue now since I only have one app


Anonymous
TRIALOP

2 years ago

Also, for the Custom Build & Deploy command, do I use npm or can I use pnpm?

1219654800577269800


brody
EMPLOYEE

2 years 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


brody
EMPLOYEE

2 years ago

npm or pnpm depends on what you use locally


Anonymous
TRIALOP

2 years ago

It is failing again 😦

1219655357450948734


Anonymous
TRIALOP

2 years ago

Will try to run it with pnpm instead of npm run


Anonymous
TRIALOP

2 years ago

Trying it out like so

1219655658614292500
1219655658853630000


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago


Anonymous
TRIALOP

2 years ago

Oops gimme 2 sec, just realised I had forgotten to push my changes after committing


Anonymous
TRIALOP

2 years ago

Looks like its working now, sorry for the stupid mistakes


Anonymous
TRIALOP

2 years ago

And thank you for your time. Your suggestion about the monorepo setup is what fixed it I think


brody
EMPLOYEE

2 years ago

awesome and now the railway side of things is setup correctly too


brody
EMPLOYEE

2 years ago

probably a bit of both


Anonymous
TRIALOP

2 years ago

Well, I'm all happy now that it works so your input is very much appreciated


brody
EMPLOYEE

2 years ago

happy to help!


Loading...