Bad Turborepo integration
Anonymous
PROOP

a year ago

Hi, feels like turborepo is not properly supported. because even when I set `NIXPACKS_TURBO_APP_NAME`, all my apps in my monorepo are built.

Also does anyone know why the start also triggers the build? Might be something with Railpack

Solved

4 Replies

NIXPACKS_TURBO_APP_NAME is ignored in Railpack.

For monorepos, you should set up a root directory so it builds within the context of the specific app within the package, and watch patterns to make Railway only build the files that are changed within the package.

Note that you should:

  • include your root directory's package.json/lockfiles here as well

  • use a custom build command that builds that specific package so it doesn't build everything (ex: don't do npm build). This can be achieved via npm build:$PACKAGE and having a corresponding build command in the package.json of the $PACKAGE

(replace npm with whatever package manager you're using)

edit:

If your apps share a common root, you do not need to set a root directory (this will be counterproductive; you'll want to use the build/deploy commands to direct Railway to build and deploy the specific packages)


Status changed to Awaiting User Response Railway 11 months ago


Anonymous
PROOP

a year ago

I'm using Nixpack, does this apply?

I tried setting up build and start commands like you said - `pnpm run build:$PACKAGE` and `pnpm run start:$PACKAGE` but I had the same behavious, it build all apps, which is slow for my codebase


Status changed to Awaiting Railway Response Railway 11 months ago


Anonymous
PROOP

a year ago

Ok I think I found the issue, there's a bug in Railway, even when the dropdown has Nixpack selected by default, unless you select it is not enabled - you can see the values goes from blank to NIXPACKS before apply the changes


I think that might be a visual bug? There's no way to have an empty builder (nixpacks/railpack must always be selected)

And yes, the suggestions above apply to both Nixpacks & Railpack. Did they work for you?

I'd also recommend switching to Railpack for faster builds slightly_smiling_face emoji


Status changed to Awaiting User Response Railway 11 months ago


Railway
BOT

7 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 7 months ago


Loading...