EAS iOS builds hanging most of the time, occasionally succeeding

In your post, please share:

  • managed
  • eas-cli/2.1.0
  • expo sdk 46

Steps:
npx eas-cli build --platform ios --no-wait --clear-cache --non-interactive

We are having issues with builds hanging during fastlane.

Hung build: Build Details — be695108-1981-4baf-8259-85198fea1fed — ea2-base-app — Expo

Successful build: Build Details — 0bf06ef9-ce8e-4353-b849-db19fa173a51 — ea2-base-app — Expo

These builds are from the same commit, yet one was successful and the other was not. The hung builds happen way more frequently than successful builds. Hung builds get to:

Fri, 21 Oct 2022 14:35:21 GMT › Executing EA2BaseApp » Bundle React Native code and images
Fri, 21 Oct 2022 14:35:21 GMT the transform cache was reset.

and then seem to hang indefinitely before we reach the EAS build time out of 2 hours. Successful builds seem to only take about 2 minutes in before moving on to the next line of output:

Fri, 21 Oct 2022 16:39:18 GMT› Executing EA2BaseApp » Bundle React Native code and images
Fri, 21 Oct 2022 16:39:18 GMT the transform cache was reset.
Fri, 21 Oct 2022 16:41:14 GMT
:warning: (/Users/expo/Library/Developer/Xcode/DerivedData/EA2BaseApp-gvinwcuptinmgcfwdsyhcofqevah/Build/Intermediates.noindex/ArchiveIntermediates/EA2BaseApp/BuildProductsPath/Release-iphoneos/main.jsbundle:5508:7)

  setTimeout(function () {
  ^ the variable "setTimeout" was not declared in function "logCapturedError"

(warning truncated)

I’ve tried playing around with some caching settings as well as changing the image that iOS uses to build (latest, default, some of the older images as well), but nothing seems to work. Right now, we are stuck submitting builds and then waiting for the build to time out, then clearing the cache and retrying the build until it is successful.

Android builds are unaffected. For reference, the Android build associated with the above iOS builds is here: Build Details — e1d5ade9-6ade-407f-825e-390fcc0174c8 — ea2-base-app — Expo

Any ideas? Thanks so much.

hi there!

  • the commit doesn’t tell the whole story unless the git index is clean, unless you’re using the cli.requiresCommit option we’ll include the uncommitted changes too (fyi/eas-build-archive.md at main · expo/fyi · GitHub). however, in this case given that the build was retried and succeeded we do know that it was indeed the same source code.
  • as you pointed out, this appears to happen during the build phase where we are generating the js bundle. the expo doctor step shows a couple red flags for me: 1) there is an incorrect version of config plugins 2) you’re using react@18.2.0, which is not meant to work with any currently released version of react-native.
  • i wonder if there might be something non-deterministic in your app javascript that is occasionally causing this.
  • we’ll investigate on our end as well

Hi, Brent, thanks for the reply.

I’ve updated my eas.json to include the requiresCommit option since that seems like good practice.

Regarding the expo doctor issues you pointed out, the config plugin issue came from standard-version-expo which we use to update version numbers before submitting. I’ve added it to package.json resolutions so it always resolves to 5.0.1 for now. I know eas now provides functionality to bump versions, so we may migrate to that soon anyway, which would obviate the need for standard-version.

React Native version was me using a caret in package.json. I’ve updated that to pin it to 18.0.

I have noticed some weirdness with Expo Go locally and variables getting replaced using process.env. I wonder if that may cause some non-deterministic builds. We’ve followed the steps here: Environment variables in Expo - Expo Documentation but we still seem to get some strange behaviour from time to time. For instance (locally), this doesn’t work all the time (process.env.baseUrl will occasionally be undefined):

export const privateApi = axios.create({
baseURL: ${process.env.baseUrl}api/,
headers: {
‘Content-Type’: ‘application/json;charset=UTF-8’,
Accept: ‘application/json’,
},
});

but this does (at least so far):

const baseUrl = process.env.baseUrl;
export const privateApi = axios.create({
baseURL: ${baseUrl}api/,
headers: {
‘Content-Type’: ‘application/json;charset=UTF-8’,
Accept: ‘application/json’,
},
});

It’s almost as if there is some kind of race condition with babel. We are looking closely at our process.env stuff today to try to debug and troubleshoot Expo Go and possible build issues related to it. That said, I have a couple examples from today (after we addressed the expo doctor issues you mentioned):

Hung build: Build Details — 36e9325c-d013-4b4e-890a-4d5962de1495 — dealerdestinationmaui — Expo
Successful build: Build Details — fc3b2624-b79e-421f-980c-e6e3c96e8640 — dealerdestinationmaui — Expo
Android build: Build Details — 06aedcd7-8cce-4cc5-9b88-01ee6e49937c — dealerdestinationmaui — Expo

After the initial failed build, we select the ‘Clear cache and retry build’ option from the web interface. As mentioned, this will occasionally, produce a good build.

Thank for your feedback and help, let me know if you have anything else you’d like me to try.

1 Like

Just checking in to see if there are any other updates or insights on this.

We had a successful build here: Build Details — 0ad74a35-7664-4d22-b558-af525c054ce0 — ea2-base-app — Expo

But, we have left out a string in app.json for ios location permissions (NSLocationWhenInUseUsageDescription), so we needed to rebuild with that added. The line we added was:

"NSLocationWhenInUseUsageDescription": "You can choose to allow location to see where you are on the event map while the app is in use. Your location will never be shared.",

Every build following has failed, all timing out when reaching

Executing EA2BaseApp » Bundle React Native code and images

    the transform cache was reset.

Successful builds will spend 2-3 minutes here and then progress. Failed builds will hang at this point forever.

Failed: Build Details — f0132645-8584-473c-9a8a-53c92f1fe290 — ea2-base-app — Expo
Failed: Build Details — 10d67654-d9c8-4b4f-97e3-958c5412d5e7 — ea2-base-app — Expo
Failed: Build Details — 4d6b426a-cde8-4e2d-8858-45d427596090 — ea2-base-app — Expo
Failed: Build Details — 87587ad3-f7ec-475b-9134-94b8f2a346de — ea2-base-app — Expo
Failed: Build Details — d6ce4b2e-4acb-42d7-9a71-46bec8155966 — ea2-base-app — Expo
In progress at the moment, but will fail: Build Details — 42ce1ea1-4823-4913-bd58-d49ef4d1e27b — ea2-base-app — Expo

I can’t imagine a one line string change caused an issue here. Prior experience tells me that eventually, this build will succeed, we’ll just need to keep submitting and then ‘Clear cache and retry build’. That said, our workflow is now being seriously disrupted with the unpredictability of iOS builds. Given that most successes are on retries, it seems like something is being cached (or not) on the EAS side.

would you be able to share your repository with me on github? that would help me a lot in being able to debug this further. i’m brentvatne on github. you can email me at brent@expo.dev to verify my identity or if you need me to agree to an nda

@brents :
I have the same issue - sometimes the build stuck at the login, sometimes at “Registering Bundle Identifier, sometimes at Syncing capabilities” stage or some other stage down the road.
Please help.
It never succeeds in my case though.

Hi @romrayster

It seems the best way forward would be for you to do what brents asks in his last message in this thread. Although if it happens at different times then I’m not sure it is the same issue, since cgitech seems to be saying that the hang happens at the same point in the build process.

At least post some links to failed builds that an Expo team member will be able to look at.

I have the same issue in SDK47. I did upgrade to SDK48 and it worked there, but had other issues like white screen of death in react navigation, so I wen’t back to SDK47 and now EAS get’s stuck on Bundle React Native and no error messages. Did you manage to fix this? @cgitech

It did work once, then it took 30 minutes on the bundle react native step and it didn’t have time to fully finish.

Hi @arvidnilber

If SDK 48 solves this for you it seems like it might be a good idea to solve the issues you were getting with it.

Try going through the Troubleshooting build errors and crashes guide and also the Production errors guide.

Also you might want to read @brents’ last message in this thread.

Thanks for your answer. However, I went back to the first commit of yesterday and now EAS build works fine, no idea what caused the issue.