a year ago
Hi
I have a monorepo setup with turborepo.
My monorepo contains two apps:
backend (hono nodeJS server)
admin dashboard (Vite React frontend).
I have two services in my Railway project
FE
--- has a custom build command: pnpm build:frontend
--- has a custom start command: pnpm start:frontendBE
--- has a custom build command: pnpm build:backend
--- has a custom start command: pnpm start:backend
My backend crashes because I parse my process.env with 'zod' (JSON validator). I do this to warn me upfront when my env vars are somehow not OK.
However, I do log my process.env before the parsing and see that my ENV vars are not set. (according to the log statement).
I have set my env variables and tried deploying several times already. Without any success.
Does someone has any clues on what I might be doing wrong.
Thanks in advance for any help 🙂
8 Replies
a year ago
hello,
you may want to check out these docs -
Waaauw, this was it. I had read this a couple of weeks ago. But didn't pop in my mind.
Still in strict mode right now, just added the env vars in my start task as well. They were only in my build task….
a year ago
no problem!
Just adding this here for any future people with the same problem 🙂

a year ago
!s
Status changed to Solved brody • about 1 year ago