expo: Running `npx eas-cli@next build --platform ios --profile development` gives error `Cannot destructure property 'expoUsername' of 'undefined' as it is undefined.``

Minimal reproducible example

.

Summary

I have no idea where this expoUsername comes from. If I understood, I could check what’s up.

Environment

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 14.2
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.17.1 - ~/.local/share/rtx/installs/node/18.17.1/bin/node
      Yarn: 1.22.19 - ~/.local/share/rtx/installs/yarn/1.22.19/bin/yarn
      npm: 9.6.7 - ~/.local/share/rtx/installs/node/18.17.1/bin/npm
      Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
    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, watchOS 10.2
    IDEs:
      Android Studio: 2023.1 AI-231.9392.1.2311.11076708
      Xcode: 15.1/15C65 - /usr/bin/xcodebuild
    npmPackages:
      babel-preset-expo: ^9.5.2 => 9.5.2
      expo: ^50.0.0-preview.1 => 50.0.0-preview.1
      react: 18.2.0 => 18.2.0
      react-native: 0.73.0 => 0.73.0
    Expo Workflow: managed

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 32 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Fixed by deleting @expo/config-plugins, then removing node_modules and my lockfile and reinstalling everything. expo-doctor complained about some old packages, now it is all green. I hope this helps!

new stable release

Could you elaborate on this? Are you referring to eas-cli version 6.1.0?

I don’t have config-plugins or eas-cli installed

What dependencies and devDependencies do you have installed? Do you have any overrides or resolutions in package.json?

Thank you @wodin, it was in fact config-plugins in our resolutions that was causing this. You’re a ⭐️

Also, is npx expo-doctor happy?

Resolved this by rm -rf node_modules then running yarn again.

Me: “Come on man, don’t you think we all thought of that?” Also me: “rm -Rf node_modules && yarn… oh shit it worked!”

Cheers for the reminder mate 😉

I am experiencing the same problem after upgrading to eas 7.2.0 (because of the apple developer API bug/change). The error only appears when trying to build for ios, with android as a target it works like intended.

This is my expo info. Please note that I am not on Expo 50 yet and are also not using config-plugins (the version used internally is AFAIK 6.0.1).

    System:
      OS: macOS 14.3
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.8.0 - ~/.nvm/versions/node/v20.8.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v20.8.0/bin/yarn
      npm: 10.4.0 - ~/.nvm/versions/node/v20.8.0/bin/npm
      Watchman: 2024.01.22.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.12.1 - /Users/hendrikbelitz/.rvm/gems/ruby-3.0.0/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
      Android SDK:
        API Levels: 26, 28, 29, 30, 31, 33
        Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 33.0.0
        System Images: android-29 | Google APIs ARM 64 v8a, android-30 | Google APIs ARM 64 v8a, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a
    IDEs:
      Android Studio: 2022.2 AI-222.4459.24.2221.9971841
      Xcode: 15.2/15C500b - /usr/bin/xcodebuild
    npmPackages:
      expo: ^48.0.16 => 48.0.16 
      react: 18.2.0 => 18.2.0 
      react-native: 0.71.14 => 0.71.14 
    npmGlobalPackages:
      eas-cli: 7.2.0
    Expo Workflow: managed

Hey, so my turn:

I’ve just upgraded expo 49 -> 50 and I get this now as well. I do not have config-plugins or eas-cli specified in my package.json, eas-cli is version 7.1.2 installed globally, expo-doctor is happy, npx expo install --fix is happy, nothing in resolutions either, I’ve removed nodes-modules and yarn.lock and re-installed everything. Metro and the web run well, but running:

> eas build --profile ios-simulator --platform ios
Loaded "env" configuration for the "ios-simulator" profile: no environment variables specified. Learn more
Cannot destructure property 'expoUsername' of 'undefined' as it is undefined.
    Error: build command failed.

Not quite sure what to do now 😕

the env-info:

> npx expo-env-info
  expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.2.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.19.0 - /opt/homebrew/opt/node@18/bin/node
      Yarn: 1.22.18 - /opt/homebrew/bin/yarn
      npm: 10.2.3 - /opt/homebrew/opt/node@18/bin/npm
      Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: 2023.1 AI-231.9392.1.2311.11330709
      Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ~19.0.1 => 19.0.1 
      expo: ~50.0.5 => 50.0.5 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.73.2 => 0.73.2 
      react-native-web: ~0.19.10 => 0.19.10 
    Expo Workflow: bare

Any help would be gratefully appreciated here

Ouch, I had this happen too.

I had left everything else alone, was using the absolute latest eas-cli, but had upgraded expo-updates from ~0.18.16 to the latest, where my package.json said ^0.24.9. In my case it might have been triggered by a compatibility issue.

To fix my issue (probably temporarily until I have to update all of Expo) I downgraded it back to ~0.18.16.

What dependencies and devDependencies do you all have installed?

If you have @expo/config-plugins or eas-cli installed as dependencies/devDependencies, uninstall them.

I am not sure if the above will fix this problem, but you should not have those installed as direct dependencies of your app anyway. @expo/config-plugins will be pulled in automatically by expo and eas-cli should be installed globally

@corasan nope just waiting till it’s out of beta to upgrade, hopefully it will be resolved by then. There were several other issues too along with this one so not worth the trouble to upgrade now imo.

+1 experiencing the same issue trying to upgrade from expo ^49.0.18 to ^50.0.0-preview.4. @pvinis did you end up finding a solution to this?