expo run:ios fails on fresh project with multiple compilation errors

I am on MacOS Big Sur with Xcode v12.4. After creating a new Expo project and immediately running npx expo run:ios, I receive a compilation error as shown below. My project directory has no spaces or special characters in the path (which was a cause reported in certain Stack Overflow posts).

I was expecting a freshly-generated project like this to run:ios without error. Does anyone have any idea why this error occurs? Thanks in advance.

$ npx create-expo-app my-react-app
✔ Downloaded and extracted project files.
✔ Installed JavaScript dependencies.

✅ Your project is ready!

To run your project, navigate to the directory and run one of the following npm commands.

- cd my-react-app
- npm run android
- npm run ios
- npm run web

$ cd my-react-app
$ npx expo run:ios

📝  iOS Bundle Identifier Learn more: https://expo.fyi/bundle-identifier

✔ What would you like your iOS bundle identifier to be? … com.dummybundle.my-react-app

✔ Created native project | gitignore skipped
✔ Added Metro config
✔ Updated package.json and added index.js entry point for iOS and Android
› Removed "main": "node_modules/expo/AppEntry.js" from package.json because we recommend using index.js as main instead

› Installing using npm
Using node to generate images. This is much slower than using native packages.
› Optionally you can stop the process and try again after successfully running `npm install -g sharp-cli`.

✔ Config synced
✔ Installed pods and initialized Xcode workspace.
› Planning build
    Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the myreactapp editor. (in target 'myreactapp' from project 'myreactapp')
› Compiling react-native Pods/glog » vlog_is_on.cc
› Compiling react-native Pods/glog » symbolize.cc
...
› Compiling react-native Pods/RCTTypeSafety » RCTConvertHelpers.mm

❌  (/Users/kevin/my-react-app/node_modules/expo-modules-core/ios/Swift/Functions/AsyncFunctionComponent.swift:94:17)

  92 |     }
  93 | 
> 94 |     let queue = queue ?? defaultQueue
     |                 ^ variable used within its own initial value
  95 | 
  96 |     queue.async { [body, name] in
  97 |       let returnedValue: ReturnType?


❌  (/Users/kevin/my-react-app/node_modules/expo-modules-core/ios/Swift/Views/ConcreteViewProp.swift:42:52)

  40 |     }
  41 |     guard let value = try propType.cast(value) as? PropType else {
> 42 |       throw Conversions.CastingException<PropType>(value)
     |                                                    ^ variable declared in 'guard' condition is not usable in its body
  43 |     }
  44 |     setter(view, value)
  45 |   }


❌  (/Users/kevin/my-react-app/node_modules/expo-modules-core/ios/Swift/Arguments/Enumerable.swift:34:63)

  32 |   static func create<ArgType>(fromRawValue rawValue: ArgType) throws -> Self {
  33 |     guard let rawValue = rawValue as? RawValue else {
> 34 |       throw EnumCastingException((type: RawValue.self, value: rawValue))
     |                                                               ^ variable declared in 'guard' condition is not usable in its body
  35 |     }
  36 |     guard let enumCase = Self.init(rawValue: rawValue) else {
  37 |       throw EnumNoSuchValueException((type: Self.self, value: rawValue))

Only the first 3 errors are shown. Loads of additional errors follow.

Hi @kevtacular,

Creating a new project and running the expo run:ios command is working fine. It seems your XCode version might be a bit far behind. Can you try updating it?