dotenv not working? How are you accessing your ENV?
Service variables are correct in Railway, yet build fails due to missing variables. Local builds work fine with dotenv, however
require('dotenv').config();
does not appear to be working on Railway. I must be missing something obvious! Any ideas? PID: 06cbb529-6fb3-4792-84b5-af7b23eb272f4 Replies
Please provide your project ID or reply with
N/A
. Thread will automatically be closed if no reply is received within 10 minutes. You can copy your project's id by pressing Ctrl/Cmd + K -> Copy Project ID.You might find these helpful:
- How to use env variables locally and when deployed
- Variables missing at build time
- environment variables are not picked up in railway build but works locally
⚠️ experimental feature
No project ID was provided. Closing thread.
on railway dotenv would fail silently since you aren't committing your .env file to github, you would have your variables set in the service settings