-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eas update appears to be changing an environment variable in my build #2236
Comments
|
@leons1767 let's say that I am maintaining the correct SERVER value in the .env file, can you explain why |
I don't think it changes the value intermittently, it just picks up whatever the SERVER value is when you run |
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. |
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. |
Perfect! Thanks, I had the same problem and it is now resolved! |
This is exactly why.. when changing .env after update is publish .. it will use the previous value set in .env when doing another publish..
|
I faced to the same problem and the |
Same happened to me. Ran |
The thing is, eas update does somehow cache .env variables. --clear-cache fixed it, but this shouldn't happen at all since it doesn't happen with eas run:android for example. |
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, the
SERVER
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
:✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK
Didn't find any issues with the project!
SERVER=https://local-domain.com
node_modules/
.expo/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
.orig.
web-build/
macOS
.DS_Store
.env*
android/
ios/
@generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
The following patterns were generated by expo-cli
OSX
.DS_Store
Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
Android/IntelliJ
build/
.idea
.gradle
local.properties
*.iml
*.hprof
node.js
node_modules/
npm-debug.log
yarn-error.log
BUCK
buck-out/
.buckd/
*.keystore
!debug.keystore
Bundle artifacts
*.jsbundle
CocoaPods
/ios/Pods/
Expo
.expo/
web-build/
dist/
@EnD expo-cli
dont_upload/
*/Spring Boot
**/build
*.keystore
*.apk
artifacts
{
"cli": {
"version": ">= 3.8.1",
"appVersionSource": "remote"
},
"build": {
"internal": {
"developmentClient": true,
"distribution": "internal",
"ios": {
"simulator": true,
"resourceClass": "m-medium",
"cocoapods": "1.15.2"
},
"android": {
"developmentClient": true
},
"channel": "development"
},
"staging": {
"distribution": "store",
"ios": {
"resourceClass": "m-medium",
"cocoapods": "1.15.2",
"autoIncrement": "buildNumber"
},
"android": {
"resourceClass": "medium",
"buildType": "app-bundle",
"autoIncrement": "versionCode"
},
"channel": "staging",
"env": {
"SERVER": "https://staging-domain.com
}
},
"production": {
"extends": "staging",
"channel": "production",
"env":{
"SERVER": "https://production-domain.com"
}
}
},
"submit": {
"production": {
"android": {
"serviceAccountKeyPath": "./dont_upload/google-service-account-key.json",
"track": "production"
},
"ios": {
"appleId": "",
"ascAppId": "",
"appleTeamId": "***"
}
},
"staging": {
"extends": "production",
"android": {
"track": "alpha"
}
}
}
}
module.exports = ({ config }) => ({
"expo": {
"name": "",
"scheme": "",
"slug": "",
"version": "1.0.1",
"orientation": "portrait",
"icon": "./assets/house_icon.png",
"userInterfaceStyle": "automatic",
"splash": {
"image": "./assets/house_icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"/"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "",
"googleServicesFile": "./config/firebase/GoogleService-Info.plist",
},
"android": {
"package": "",
"googleServicesFile": "./config/firebase/google-services.json",
"config": {
"googleMaps": {
"apiKey": ''
}
}
},
"web": {
"favicon": "./assets/favicon.png"
},
"extra": {
"eas": {
"projectId": ""
},
},
"plugins": [
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "static"
}
}
],
"@react-native-firebase/app",
"@react-native-firebase/crashlytics",
"@react-native-firebase/perf",
[
"expo-image-picker",
{
"cameraPermission": "You may need to take photos of your listing with the device camera.",
"photosPermission": "You may need to upload photos of your listing from the photo gallery.",
}
],
["expo-tracking-transparency", {
"userTrackingPermission": "This identifier will be used to deliver personalized ads to you."
}],
"./plugins/android_manifest",
"./plugins/main_activity"
],
"updates": {
"url": "***"
},
"runtimeVersion": {
"policy": "sdkVersion"
},
},
...config
})
{
"react-native-google-mobile-ads": {
"android_app_id": "",
"ios_app_id": "",
"user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you.",
"sk_ad_network_items": [***],
}
}
The text was updated successfully, but these errors were encountered: