Conversion to TurboRepo Fails
jared-leddy
HOBBYOP

2 months ago

Ref Deploy:
https://railway.com/project/ef571a22-8128-4960-abb3-d46b95b0729b/service/6c3334b8-91cc-4b6a-bc89-ed0c319b436b?environmentId=80693b22-bcec-4979-8865-d53cde0f387c&id=30b713bc-bc27-415d-994c-8ba32133fc00#build

The logs are talking about a TypeScript problem, but we don't have one on our end. We can run npm install , npm run build and our start command all without issues.

Solved$20 Bounty

0 Replies

jared-leddy
HOBBYOP

2 months ago

Why it works locally but not in deploy

Local: your Node/TS toolchain is picking up the right tsconfig values (with "experimentalDecorators": true, "emitDecoratorMetadata": true, "useDefineForClassFields": false).

Deploy (Nixpacks): the builder is likely defaulting to standard decorators (TS 5.6+) because useDefineForClassFields isn’t being respected, or experimentalDecorators isn’t making it into the right tsconfig that Nest sees when it runs nest build.

That’s why it explodes only in CI/CD.


jared-leddy
HOBBYOP

2 months ago

I figured out the problem. Took about two days to figure this out.

Solution:
For our API, we're using NestJS. We have a TurboRepo package called typescript-config which has our NestJS-specific config items in there. While this works locally, the Nest "engine" doesn't play nicely with our TurboRepo "shared packages" format.

We copied our config over directly into our API's tsconfig.json file, and the build works fine now.


Status changed to Solved noahd 2 months ago


Loading...