Eas build only succeeds when "developmentClient" is set to true

eas build succeeds when the --profile flag is set to “dev”, but fails when the --profile flag is set to “preview”.

My eas.json looks like this:

{

  "build": {

    "release": {},

    "preview": {

      "distribution": "internal",

      "cache": {

        "disabled": true

      }

    },

    "dev": {

      "developmentClient": true,

      "distribution": "internal",

      "cache": {

        "disabled": true

      }

    }

  },

  "cli": {

    "version": ">= 0.34.1",

    "requireCommit": true

  }

}

Expo diagnostics:

Expo CLI 4.12.11 environment info:
    System:
      OS: Windows 10 10.0.19043
    Binaries:
      Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.10 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      expo: ^42.0.0 => 42.0.5
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2
      react-native-web: ~0.13.12 => 0.13.18
    Expo Workflow: managed

Build ID 1: bb38af92-4864-408d-a7ed-3a6e2ef2f929
Build ID 2: af87249c-329a-4ba1-95ea-4afb1a2ed020

dev is a “debug” build dev client whereas “preview” will do a release build. in dev client build we don’t compile your app js because that’s done when you run expo start --dev-client and load it in dev client.

notice that in your release build it fails while compiling your js. the error message there points you exactly to where there is a problem in your code.

try doing a fresh clone of your repo and running it to see if that works. probably there is some file that is not included in git or has some name casing issues

1 Like

@brents thank you for your detailed explanation.

You were right to suspect a git issue.

This was my .gitignore file:

# will be generated after `expo run:ios` or `expo run:android`
ios/
android/
metro.config.js
react-native.config.js
index.js

All the index.js files in my project were ignored.

Oops!

Everything works perfectly now.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.