Deployment using Bun & Railpacks does display any env variables
atresnjo
HOBBYOP

6 months ago

Update: Sorry for the title. I've obviously meant "does NOT display any env variables"

Running Bun 1.2.15 with railpacks

I set the env variables in the railway ui, but when i console log them with process.env or Bun.env they do not appear

ValiError: Invalid key: Expected "DATABASE_URL" but received undefined

Here's an output of bun env / process env

Environment Variables:

process.env {
  npm_command: "run-script",
  NODE: "/mise/installs/node/22.16.0/bin/node",
  npm_config_local_prefix: "/app/apps/server",
  PWD: "/app/apps/server",
  HOME: "/root",
  npm_lifecycle_script: "bun dist/index.js",
  TURBO_HASH: "ca952667780fceed",
  npm_package_name: "controlling-api",
  npm_lifecycle_event: "start",
  SHLVL: "0",
  npm_config_user_agent: "bun/1.2.15 npm/? node/v22.6.0 linux x64",
  npm_execpath: "/app/node_modules/bun/bin/bun.exe",
  npm_package_json: "/app/apps/server/package.json",
  PATH: "/app/apps/server/node_modules/.bin:/app/apps/server/node_modules/.bin:/app/apps/node_modules/.bin:/app/node_modules/.bin:/node_modules/.bin:/app/node_modules/.bin:/app/node_modules/.bin:/node_modules/.bin:/app/node_modules/.bin:/app/node_modules/.bin:/app/node_modules/.bin:/mise/installs/bun/1.2.15/bin:/mise/installs/node/22.16.0/bin:/mise/shims:/mise/shims:/mise/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  CI: "true",
  npm_node_execpath: "/mise/installs/node/22.16.0/bin/node",
  _: "/app/node_modules/.bin/bun",
  TZ: undefined,
  NODE_TLS_REJECT_UNAUTHORIZED: undefined,
  BUN_CONFIG_VERBOSE_FETCH: undefined
}

Anyone an idea? Thanks!

Solved

4 Replies

atresnjo
HOBBYOP

6 months ago

Project ID: b2a1c57e-450f-4526-9df5-4cfdc363017f


atresnjo
HOBBYOP

6 months ago

my railway ui

1380830238757621800


atresnjo
HOBBYOP

6 months ago

i believe it might be turborepo related, if i just cd to the folder and do bun run start the env is loaded

edit: yeah, solved it.. had to pass them in my turbo.json


brody
EMPLOYEE

6 months ago

!s


Status changed to Solved brody 6 months ago


Loading...