Mainly seeking to provide internal previews for different teams; it will never run on localhost, we have different deployment endpoints available :
{
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"channel": "development",
"env": {
"EXPO_PUBLIC_API_URL": "https://dev.somedomain.com"
}
},
"preview": {
"distribution": "internal",
"channel": "staging",
"env": {
"EXPO_PUBLIC_API_URL": "https://staging.somedomain.com"
}
},
"production": {
"channel": "main",
"env": {
"EXPO_PUBLIC_API_URL": "https://prod.somedomain.com"
}
}
}
}
I’m totally stuck when it comes to updates.
The app consumes process.env.EXPO_PUBLIC_API_URL.
When developing locally in the simulator, we “override” this by some env.local file containing the following : EXPO_PUBLIC_API_URL=http://localhost:3000
It worked locally without problems.
I’ve made the mistake to build and update locally, having this env.local file in place containing http://localhost:3000. It overrode EXPO_PUBLIC_API_URL, the previews got stuck, pointing then to localhost.
So I updated env.local, placed https://dev.somedomain.com or https://staging.somedomain.com and ran a build again with it for each.
Things got fixed when installing the build on the phone.
But things remained the same for the updates (or when opening within the expo app), pointing to localhost:3000 (even after being sent with the correct override in env.local, pointing to the dev/staging.domain.com). So basically, updates are stuck.
The whole thing seems as “unstable” as weird; there might obviously be something i’m missing :
- unable to understand with the values in eas.json got overriden by env.local
- unable to understand why updates could get stuck by a stale value
If anyone has pointer to correctly handle this, that’d be great