Skip to content
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

Expo 49 - ENV update #2256

Closed
gabriel-nascimento-syngenta opened this issue Feb 27, 2024 · 2 comments
Closed

Expo 49 - ENV update #2256

gabriel-nascimento-syngenta opened this issue Feb 27, 2024 · 2 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@gabriel-nascimento-syngenta
Copy link

gabriel-nascimento-syngenta commented Feb 27, 2024

Build/Submit details page URL

No response

Summary

I have 2 env files
.env.development and .env.production

and building and starting (debug) are working fine. The problem is with eas update.
If I have a dev build, and push a update to dev channel, it subscribes with the production .env

"scripts": {
    "start": "NODE_ENV=development npx expo start --dev-client",
    "start:prod": "NODE_ENV=production npx expo start --no-dev --minify",
    "android": "NODE_ENV=development npx expo run:android",
    "build:local": "eas build --local --profile development",
    "build:prod": "eas build --profile production",
    "build:dev": "eas build --profile development",
    "build:qa": "eas build --profile preview",
    "submit:prod": "eas submit --profile production",
    "submit:dev": "eas submit --profile development",
    "submit:qa": "eas submit --profile preview",
    "update:prod": "eas update",
    "update:dev": "eas update",
    "update:qa": "eas update",
    "ios": "npx expo run:ios",
    "web": "expo start --web"
  },
"build": {
    "development": {
      "channel": "development",
      "autoIncrement": true,
      "ios": {
        "resourceClass": "m-medium",
        "image": "macos-ventura-13.6-xcode-15.2"
      },
      "env": {
        "NODE_ENV": "development"
      }
    },

    "production": {
      "channel": "main",
      "autoIncrement": true,
      "ios": {
        "resourceClass": "m-medium",
        "image": "macos-ventura-13.6-xcode-15.2"
      },
      "env": {
        "NODE_ENV": "production"
      }
    }
  }

Managed or bare?

Managed

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.3.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.21 - /usr/local/bin/yarn
npm: 9.8.1 - /usr/local/bin/npm
Managers:
CocoaPods: 1.14.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11076708
Xcode: 15.2/15C500b - /usr/bin/xcodebuild
npmPackages:
expo: ^49.0.0 => 49.0.22
react: 18.2.0 => 18.2.0
react-native: 0.72.10 => 0.72.10
npmGlobalPackages:
eas-cli: 7.3.0
Expo Workflow: managed

Error output

No response

Reproducible demo or steps to reproduce from a blank project

1 - Create 2 .env files
2 - Use expo 49
3 - Build a dev build
4 - Update the dev build with eas update

@gabriel-nascimento-syngenta gabriel-nascimento-syngenta added the needs review Issue is ready to be reviewed by a maintainer label Feb 27, 2024
@mkhoussid
Copy link

@szdziedzic
Copy link
Member

Hi there, I think that doing

...
"update:prod": "NODE_ENV=production eas update",
"update:dev": "NODE_ENV=development eas update",
...

can help 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants