Environment Variables are returning undefined
I started getting this issue several days ago but I hadn't had time to look into it until now. Suddenly all builds are failing for either service in the project indicating that the env vars are not valid.
I ended up adding the following to one of the apps to see what was happening:
In the deploy logs I see the following:
If I check the Settings -> Variables section for one of the PRs that are failing with this issue all 16 variables are present with values.
The only things that I recall changing around that time were upgrading
bun
which runs the two Discord bots but I're tried downgrading that, and that I deleted the staging
branch from the repo but kept the environment in Railway.Solution:Jump to solution
yes, indeed, please read their docs page -
https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#environment-modes...
9 Replies
Project ID:
5699151a-d2d8-47c5-9c29-35462dd2497f
5699151a-d2d8-47c5-9c29-35462dd2497f
are you perhaps using turbo?
Yes, indeed.
And I think I upgraded. Is that it?
Solution
yes, indeed, please read their docs page -
https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#environment-modes
That's new with turbo 2? I totally missed that. I wouldn't have guessed turbo was the cause here.
not sure what version uses strict mode by default but yeah that's the issue, you aren't the first person to report missing environment variables
I figured it was going to be something like that, but I was definitely confused. Looking at
turbo
, I was on 1.13.4 and that's the last 1.x version so its definitely something in 2.
I just test loose mode and that's working, so that was 100% it. Thanks for the super fast response. I appreciate it.no problem!