Open HM-23-HM opened 6 months ago
eas update
does not have access to SECRETS variables or environment variables that you defined in eas.json. You can use dotenv
to export the .env
variables locally to eas update
. Obviously, you need to maintain the correct SERVER value in your .env
.
@leons1767 let's say that I am maintaining the correct SERVER value in the .env file, can you explain why eas update
changes the value intermittently?
@leons1767 let's say that I am maintaining the correct SERVER value in the .env file, can you explain why
eas update
changes the value intermittently?
I don't think it changes the value intermittently, it just picks up whatever the SERVER value is when you run eas update
. You can ensure the right environment variables by loading it from .env
using dotenv
prior to eas update
.
I deleted a previous comment, because I found the relevant documentation for this issue
I deleted a previous comment, because I found the relevant documentation for this issue
Glad that you are able to find the answer from the documentation. Have a nice day!
happen to me also, it was intermittenly, because it somehow cached the .env value.
so the update needs to be run with --clear-cache
flag
I was breaking my head because this too, I tough that the .env file picked was a wrong one but the problem was the cache, deleting the cache helped me too
"publish:prod": "cross-env NODE_ENV=production eas update --clear-cache --channel prod --message \"Automated publish to prod\""
As described here, it is NOT the cache as mentioned before. Is the way EAS UPDATE works that DO NOT use the eas.json env vars a EAS BUILD does.
happen to me also, it was intermittenly, because it somehow cached the .env value. so the update needs to be run with
--clear-cache
flag
Perfect! Thanks, I had the same problem and it is now resolved!
happen to me also, it was intermittenly, because it somehow cached the .env value. so the update needs to be run with
--clear-cache
flag
This is exactly why.. when changing .env after update is publish .. it will use the previous value set in .env when doing another publish..
--clear-cache
works !
NODE_ENV=production eas update --clear-cache
I faced to the same problem and the --clear-cache
works for loading env var for eas update
Same happened to me. Ran eas update
locally and it used a cached .env
file, which broke production.
Very scary to use this command, therefore set up a github workflow to trigger it in an encapsulated environment.
Build/Submit details page URL
https://expo.dev/accounts/hodeem/projects/sheltah/builds/7eb6fb53-0f9a-4ba0-b00d-cba0834d947d
Summary
I have
SERVER
set in both the local .env file and the eas.json file. The .env file is in the .gitignore file. In the JS code, theSERVER
value is referenced by usingconst SERVER = process.env.SERVER
.If I run
eas build
with a profile, platform etc., the JS code uses the correctSERVER
value from selected build profile.However, when I run
eas update
, the JS code intermittently uses the SERVER value that I only have in the local .env file.I say "intermittently" because it appears that the change happens on the first
eas update
, but I can't change theSERVER
value via. the .env file with any subsequenteas update
. It has happened twice so far. Can someone let me know what I'm doing wrong or if this is a legitimate bug.Managed or bare?
Managed
Environment
Output from
npx expo-env-info
:Error output
N/A
Reproducible demo or steps to reproduce from a blank project
eas build --auto-submit --profile production --platform android
eas submit --channel production
Files: .env
.gitignore
eas.json
app.config.js
app.json: