env variables
chrithvik
HOBBYOP

a month ago

i added the env variables in the service , but when deploying getting the error as invalid string received undefined

$10 Bounty

2 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway about 1 month ago


chrithvik
HOBBYOP

a month ago

Which framework/language are you using?

Monorepo: Turborepo + Bun workspaces

Server (the failing Railway service):

Language: TypeScript

Runtime: Bun

HTTP framework: Fastify

API: tRPC

Auth: Better Auth

DB: Drizzle ORM + PostgreSQL (pg)

Env validation: @t3-oss/env-core + Zod

Build: tsdown (bundles to dist/index.mjs)

Web app:

Framework: Next.js 16 (React 19)

Data: tRPC + TanStack Query

Auth: Better Auth client

Deploy target: Railway (Railpack), with separate railway.json configs for apps/server and apps/web.


Turborepo sets the env mode to strict by default, you need to enable loose mode to allow all environment variables for the process to be available. To enable it, you can follow the instructions in the turborepo docs: https://turborepo.dev/docs/crafting-your-repository/using-environment-variables#loose-mode


Welcome!

Sign in to your Railway account to join the conversation.

Loading...