EAS build success with profile development but fails with profile preview

Before posting your question, make sure you’ve read the documentation for both EAS Build & Submit.

If your Android or iOS build is failing- make sure you do your own research on the error message first before posting (this will give you a better understanding, and you might even find that someone else has already solved the issue!) It is not up to the Expo team to debug your project or build.

In your post, please share:

  • Whether you are bare or managed workflow: managed
  • Your eas-cli version: 3.13.2
  • What you have tried so far: I ask on Discord (no response so far) and I try to find some issues in expo/expo repo. In a similar issue someone suggest change the entry point of the app from index.ts to index.js but this doesn’t work. You can clone the repo: GitHub - jrafaaael/die-with-us-mobile

Error log from build profile preview says that:

[stderr] 
● Validation Warning:
[stderr] 
  Unknown option "serializer.isThirdPartyModule" with value (module) =>
[stderr] 
      /(?:^|[/\\])node_modules[/\\]/.test(module.path) was found.
[stderr] 
  This is probably a typing mistake. Fixing it will remove this message.
[stderr] 
● Validation Warning:
[stderr] 
  Unknown option "symbolicator.customizeStack" with value async (stack, _) => stack was found.
[stderr] 
  This is probably a typing mistake. Fixing it will remove this message.
[stderr] 
● Validation Warning:
[stderr] 
  Unknown option "unstable_perfLoggerFactory" with value () => {
[stderr] 
  class Logger {
[stderr] 
    start() {}
[stderr] 
    end() {}
[stderr] 
    annotate() {}
[stderr] 
    point() {}
[stderr] 
    subSpan() {
[stderr] 
      return this;
[stderr] 
    }
[stderr] 
  }
[stderr] 
  return new Logger();
[stderr] 
} was found.
[stderr] 
  This is probably a typing mistake. Fixing it will remove this message.
warning: the transform cache was reset.
Welcome to Metro v0.76.5
              Fast - Scalable - Integrated
> Task :shopify_flash-list:compileReleaseKotlin
> Task :expo-modules-core:buildCMakeRelWithDebInfo[armeabi-v7a]
> Task :react-native-reanimated:buildCMakeRelWithDebInfo[x86]
> Task :expo-modules-core:configureCMakeRelWithDebInfo[x86]
> Task :shopify_flash-list:compileReleaseKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /home/expo/.gradle/caches/transforms-3/582c024f00cf8f3de3b841e4845cf8e5/transformed/jetified-kotlin-stdlib-jdk8-1.6.10.jar (version 1.6)
    /home/expo/.gradle/caches/transforms-3/04bab545784123ef0f9f1288eb02d0a1/transformed/jetified-kotlin-stdlib-jdk7-1.5.30.jar (version 1.5)
    /home/expo/.gradle/caches/transforms-3/588e21d1c03e36867bf3b6ce12e348df/transformed/jetified-kotlin-stdlib-1.5.30.jar (version 1.5)
    /home/expo/.gradle/caches/transforms-3/1bf77ce9dd728bef21729eba9b457195/transformed/jetified-kotlin-stdlib-common-1.5.30.jar (version 1.5)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: /home/expo/workingdir/build/node_modules/@shopify/flash-list/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutShadow.kt: (81, 13): Name shadowed: actualScrollOffset
w: /home/expo/workingdir/build/node_modules/@shopify/flash-list/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt: (14, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/@shopify/flash-list/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt: (147, 30): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/@shopify/flash-list/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt: (148, 18): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
> Task :shopify_flash-list:extractReleaseAnnotations
> Task :shopify_flash-list:compileReleaseJavaWithJavac
> Task :shopify_flash-list:mergeReleaseGeneratedProguardFiles
> Task :shopify_flash-list:mergeReleaseConsumerProguardFiles
> Task :shopify_flash-list:mergeReleaseJavaResource
> Task :shopify_flash-list:syncReleaseLibJars
> Task :shopify_flash-list:bundleReleaseLocalLintAar
> Task :expo:extractDeepLinksRelease
> Task :expo-application:extractDeepLinksRelease
> Task :expo-battery:extractDeepLinksRelease
> Task :expo-constants:extractDeepLinksRelease
> Task :expo-crypto:extractDeepLinksRelease
> Task :expo-dev-client:extractDeepLinksRelease
> Task :expo-dev-launcher:extractDeepLinksRelease
> Task :expo-dev-menu:extractDeepLinksRelease
> Task :expo-dev-menu-interface:extractDeepLinksRelease
> Task :expo-file-system:extractDeepLinksRelease
> Task :expo-font:extractDeepLinksRelease
> Task :expo-json-utils:extractDeepLinksRelease
> Task :expo-keep-awake:extractDeepLinksRelease
> Task :expo-manifests:extractDeepLinksRelease
> Task :expo-splash-screen:extractDeepLinksRelease
> Task :expo-updates-interface:extractDeepLinksRelease
> Task :react-native-gesture-handler:extractDeepLinksRelease
> Task :react-native-mmkv:extractDeepLinksRelease
> Task :react-native-safe-area-context:extractDeepLinksRelease
> Task :react-native-screens:extractDeepLinksRelease
> Task :react-native-svg:extractDeepLinksRelease
> Task :shopify_flash-list:extractDeepLinksRelease
> Task :expo:compileReleaseLibraryResources
> Task :expo-application:compileReleaseLibraryResources
> Task :expo-battery:compileReleaseLibraryResources
> Task :expo-constants:compileReleaseLibraryResources
> Task :expo-crypto:compileReleaseLibraryResources
> Task :expo-dev-client:compileReleaseLibraryResources
> Task :expo-dev-launcher:compileReleaseLibraryResources
> Task :react-native-reanimated:configureCMakeRelWithDebInfo[x86_64]
> Task :expo-dev-menu:compileReleaseLibraryResources
> Task :expo-dev-menu-interface:compileReleaseLibraryResources
> Task :expo-file-system:compileReleaseLibraryResources
> Task :expo-font:compileReleaseLibraryResources
> Task :expo-json-utils:compileReleaseLibraryResources
> Task :expo-keep-awake:compileReleaseLibraryResources
> Task :expo-manifests:compileReleaseLibraryResources
> Task :expo-splash-screen:compileReleaseLibraryResources
> Task :expo-updates-interface:compileReleaseLibraryResources
> Task :react-native-gesture-handler:compileReleaseLibraryResources
> Task :react-native-mmkv:compileReleaseLibraryResources
> Task :react-native-safe-area-context:compileReleaseLibraryResources
> Task :react-native-screens:compileReleaseLibraryResources
> Task :react-native-svg:compileReleaseLibraryResources
> Task :shopify_flash-list:compileReleaseLibraryResources
> Task :expo:bundleLibCompileToJarRelease
> Task :react-native-gesture-handler:bundleLibCompileToJarRelease
> Task :react-native-mmkv:bundleLibCompileToJarRelease
> Task :react-native-safe-area-context:bundleLibCompileToJarRelease
> Task :react-native-screens:bundleLibCompileToJarRelease
> Task :react-native-svg:bundleLibCompileToJarRelease
> Task :shopify_flash-list:bundleLibCompileToJarRelease
> Task :expo:bundleLibResRelease
> Task :expo:bundleLibRuntimeToJarRelease
> Task :expo:createFullJarRelease
> Task :expo:writeReleaseLintModelMetadata
> Task :expo-application:bundleLibResRelease
> Task :expo-application:bundleLibRuntimeToJarRelease
> Task :expo-application:createFullJarRelease
> Task :expo-application:writeReleaseLintModelMetadata
> Task :expo-battery:bundleLibResRelease
> Task :expo-battery:bundleLibRuntimeToJarRelease
> Task :expo-battery:createFullJarRelease
> Task :expo-battery:writeReleaseLintModelMetadata
> Task :expo-constants:bundleLibResRelease
> Task :expo-constants:bundleLibRuntimeToJarRelease
> Task :expo-constants:createFullJarRelease
> Task :expo-constants:writeReleaseLintModelMetadata
> Task :expo-crypto:bundleLibResRelease
> Task :expo-crypto:bundleLibRuntimeToJarRelease
> Task :expo-crypto:createFullJarRelease
> Task :expo-crypto:writeReleaseLintModelMetadata
> Task :expo-dev-client:bundleLibResRelease NO-SOURCE
> Task :expo-dev-client:bundleLibRuntimeToJarRelease
> Task :expo-dev-client:createFullJarRelease
> Task :expo-dev-client:writeReleaseLintModelMetadata
> Task :expo-dev-launcher:bundleLibResRelease
> Task :expo-dev-launcher:bundleLibRuntimeToJarRelease
> Task :expo-dev-launcher:createFullJarRelease
> Task :expo-dev-launcher:writeReleaseLintModelMetadata
> Task :expo-dev-menu:bundleLibResRelease
> Task :expo-dev-menu:bundleLibRuntimeToJarRelease
> Task :expo-dev-menu:createFullJarRelease
> Task :expo-dev-menu:writeReleaseLintModelMetadata
> Task :expo-dev-menu-interface:bundleLibResRelease
> Task :expo-dev-menu-interface:bundleLibRuntimeToJarRelease
> Task :expo-dev-menu-interface:createFullJarRelease
> Task :expo-dev-menu-interface:writeReleaseLintModelMetadata
> Task :expo-file-system:bundleLibResRelease
> Task :expo-file-system:bundleLibRuntimeToJarRelease
> Task :expo-file-system:createFullJarRelease
> Task :expo-file-system:writeReleaseLintModelMetadata
> Task :expo-font:bundleLibResRelease
> Task :expo-font:bundleLibRuntimeToJarRelease
> Task :expo-font:createFullJarRelease
> Task :expo-font:writeReleaseLintModelMetadata
> Task :expo-json-utils:bundleLibResRelease
> Task :expo-json-utils:bundleLibRuntimeToJarRelease
> Task :expo-json-utils:createFullJarRelease
> Task :expo-json-utils:writeReleaseLintModelMetadata
> Task :expo-keep-awake:bundleLibResRelease
> Task :expo-keep-awake:bundleLibRuntimeToJarRelease
> Task :expo-keep-awake:createFullJarRelease
> Task :expo-keep-awake:writeReleaseLintModelMetadata
> Task :expo-manifests:bundleLibResRelease
> Task :expo-manifests:bundleLibRuntimeToJarRelease
> Task :expo-manifests:createFullJarRelease
> Task :expo-manifests:writeReleaseLintModelMetadata
> Task :expo-splash-screen:bundleLibResRelease
> Task :expo-splash-screen:bundleLibRuntimeToJarRelease
> Task :expo-splash-screen:createFullJarRelease
> Task :expo-splash-screen:writeReleaseLintModelMetadata
> Task :expo-updates-interface:bundleLibResRelease NO-SOURCE
> Task :expo-updates-interface:bundleLibRuntimeToJarRelease
> Task :expo-updates-interface:createFullJarRelease
> Task :expo-updates-interface:writeReleaseLintModelMetadata
> Task :react-native-gesture-handler:bundleLibResRelease
> Task :react-native-gesture-handler:bundleLibRuntimeToJarRelease
> Task :react-native-gesture-handler:createFullJarRelease
> Task :react-native-gesture-handler:writeReleaseLintModelMetadata
> Task :react-native-mmkv:bundleLibResRelease NO-SOURCE
> Task :react-native-mmkv:bundleLibRuntimeToJarRelease
> Task :react-native-mmkv:createFullJarRelease
> Task :react-native-mmkv:writeReleaseLintModelMetadata
> Task :react-native-safe-area-context:bundleLibResRelease
> Task :react-native-safe-area-context:bundleLibRuntimeToJarRelease
> Task :react-native-safe-area-context:createFullJarRelease
> Task :react-native-safe-area-context:writeReleaseLintModelMetadata
> Task :react-native-screens:bundleLibResRelease
> Task :react-native-screens:bundleLibRuntimeToJarRelease
> Task :react-native-screens:createFullJarRelease
> Task :react-native-screens:writeReleaseLintModelMetadata
> Task :react-native-svg:bundleLibResRelease NO-SOURCE
> Task :react-native-svg:bundleLibRuntimeToJarRelease
> Task :react-native-svg:createFullJarRelease
> Task :react-native-svg:writeReleaseLintModelMetadata
> Task :shopify_flash-list:bundleLibResRelease
> Task :shopify_flash-list:bundleLibRuntimeToJarRelease
> Task :shopify_flash-list:createFullJarRelease
> Task :shopify_flash-list:writeReleaseLintModelMetadata
> Task :expo:copyReleaseJniLibsProjectOnly
> Task :expo-application:copyReleaseJniLibsProjectOnly
> Task :expo-battery:copyReleaseJniLibsProjectOnly
> Task :expo-constants:copyReleaseJniLibsProjectOnly
> Task :expo-crypto:copyReleaseJniLibsProjectOnly
> Task :expo-dev-client:copyReleaseJniLibsProjectOnly
> Task :expo-dev-launcher:copyReleaseJniLibsProjectOnly
> Task :expo-dev-menu:copyReleaseJniLibsProjectOnly
> Task :expo-dev-menu-interface:copyReleaseJniLibsProjectOnly
> Task :expo-file-system:copyReleaseJniLibsProjectOnly
> Task :expo-font:copyReleaseJniLibsProjectOnly
> Task :expo-json-utils:copyReleaseJniLibsProjectOnly
> Task :expo-keep-awake:copyReleaseJniLibsProjectOnly
> Task :expo-manifests:copyReleaseJniLibsProjectOnly
> Task :expo-splash-screen:copyReleaseJniLibsProjectOnly
> Task :expo-updates-interface:copyReleaseJniLibsProjectOnly
> Task :react-native-gesture-handler:copyReleaseJniLibsProjectOnly
> Task :react-native-mmkv:copyReleaseJniLibsProjectOnly
> Task :react-native-safe-area-context:copyReleaseJniLibsProjectOnly
> Task :react-native-screens:copyReleaseJniLibsProjectOnly
> Task :react-native-svg:copyReleaseJniLibsProjectOnly
> Task :shopify_flash-list:copyReleaseJniLibsProjectOnly
> Task :app:createBundleReleaseJsAndAssets
Error: node_modules/expo-router/entry.js:Invalid call at line <unknown>: undefined
First argument of `require.context` should be a string denoting the directory to require.
    at transformJS (/home/expo/workingdir/build/node_modules/metro-transform-worker/src/index.js:224:15)
    at transformJSWithBabel (/home/expo/workingdir/build/node_modules/metro-transform-worker/src/index.js:337:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.transform (/home/expo/workingdir/build/node_modules/metro-transform-worker/src/index.js:451:12)
[stderr] 
error node_modules/expo-router/entry.js: node_modules/expo-router/entry.js:Invalid call at line <unknown>: undefined
[stderr] 
First argument of `require.context` should be a string denoting the directory to require.
> Task :app:createBundleReleaseJsAndAssets FAILED
> Task :expo-modules-core:buildCMakeRelWithDebInfo[x86]
> Task :react-native-reanimated:buildCMakeRelWithDebInfo[x86_64]
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
744 actionable tasks: 744 executed
[stderr] 
FAILURE: Build completed with 2 failures.
[stderr] 
1: Task failed with an exception.
[stderr] 
-----------
[stderr] 
* What went wrong:
[stderr] 
Execution failed for task ':app:createBundleReleaseJsAndAssets'.
[stderr] 
> Process 'command 'node'' finished with non-zero exit value 1
[stderr] 
* Try:
[stderr] 
> Run with --stacktrace option to get the stack trace.
[stderr] 
> Run with --info or --debug option to get more log output.
[stderr] 
> Run with --scan to get full insights.
[stderr] 
==============================================================================
[stderr] 
2: Task failed with an exception.
[stderr] 
-----------
[stderr] 
* What went wrong:
[stderr] 
java.lang.StackOverflowError (no error message)
[stderr] 
* Try:
[stderr] 
> Run with --stacktrace option to get the stack trace.
[stderr] 
> Run with --info or --debug option to get more log output.
[stderr] 
> Run with --scan to get full insights.
[stderr] 
==============================================================================
[stderr] 
* Get more help at https://help.gradle.org
[stderr] 
BUILD FAILED in 8m 50s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

In Expo Router, we use environment variables to communicate environment settings to the client code. The babel plugin used in the repro appears to be disabling these values. I recommend updating the babel plugin to ignore the env vars that we use in Expo Router:

["transform-inline-environment-variables", {
  "exclude": [
    "EXPO_ROUTER_APP_ROOT",
    "EXPO_ROUTER_PROJECT_ROOT",
    "EXPO_ROUTER_IMPORT_MODE",
    "EXPO_ROUTER_IMPORT_MODE_ANDROID",
    "EXPO_ROUTER_IMPORT_MODE_IOS",
    "EXPO_ROUTER_IMPORT_MODE_WEB",
  ]
}]

In SDK 49, we’ll have official support for .env files, and work arounds like this will no longer be needed.

2 Likes

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