EAS: Entrypoint build failure on iOS

I’m on the managed workflow. Recently migrated from expo build to EAS build and builds are working on Android but not iOS. iOS fails on the “Run fastlane” step, resulting in some Xcode logs.

In the Xcode logs, I found the following error:

Error: @build-script-error-begin
Error loading application entrypoint. If your entrypoint is not index.js, please set ENTRY_FILE environment variable with your app entrypoint.
@build-script-error-end

However my project’s entrypoint is index.js. And given that the Android build works fine, I’m not sure why iOS is failing. Any ideas as to what could be going wrong?

is it possible that you still have a different entry point in your package.json?

If you provide a link to the failing build, we can take a closer look and possibly suggest further troubleshooting steps.

I do have the following line in my package.json:

"main": "src/index.js",

Do I need to move index.js out of src/ ?

Here is a link to the failing build on iOS: Build Details — 9d210423-4fe9-43cf-9082-dd7bbd7d3650 — coin-tracker — Expo

And the corresponding successful build on Android: Build Details — c388cc67-712f-45b0-94ce-197431bc1a63 — coin-tracker — Expo

Yes, it should be:

"main": "index.js",
2 Likes

Thanks!

Does the previous recommendation work for you?

According to the docs, Custom "main" entry point in package.json is not supported

This is what Keith linked to in his comment above, but the link was changed, so his doesn’t currently take you to the correct place on that page.

So if you’re on the managed workflow, your package.json probably has a line that looks like this:

  "main": "node_modules/expo/AppEntry.js",

If you’re on the bare workflow, this probably needs to be:

  "main": "index.js",

Although, I’ve just run npx expo prebuild in a new test app and it did not make the above change as it used to. So I’m not sure the above documentation is true anymore.

Could you give some more information about what’s going wrong for you?

EDIT: The above is slightly out of date. It’s still valid for Expo SDK <= 48.

Expo SDK 49 supports custom entrypoints. From the release announcement:

  • expo export:embed has replaced the @react-native-community/cli bundle command in the “Bundle React Native code and images” build phase. This has allowed us to add support for custom entry points — you can change "main" in package.json to point to any source file (be sure to use registerRootComponent in the new entry file, if you aren’t using Expo Router).

And they have now updated the docs.

1 Like