Hi,
I have recently switched over to EAS and have created a build for a dev client with the following config
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"releaseChannel": "development",
"env": {
"API_URL": "foo",
},
"ios": {
"autoIncrement": true,
"simulator": true
}
},
}
I have successfully built the client and installed it on my iOS simulator.
The problem I am having is accessing the Environment variables.
I have them in a .env
file with matching keys in the eas.json
But when I try to access the process.env.API_URL
I get undefined.
If I log out my env object it looks like this
{
"NODE_ENV": "development",
}
I have not used an extra object in my app.json/app.config.js as I have moved over to EAS.
If I use an extra object as per the docs I can access the variables via expo-constants.
Can someone please advise where I am going wrong?
- Managed workflow
-
eas-cli
version eas-cli/0.41.1
I have tried creating new builds of the dev client and creating a build for production testflight and the app still crashes unable to access environment variables.