EAS build fails when using `hermes` on a monorepo

EAS build seems to fail when hermes is enabled on a monorepo project.

  • Managed workflow
  • eas-cli/0.34.1 darwin-x64 node-v15.14.0
  • expo --version // => 4.12.11
  • Expo SDK43

I’m trying to set up a monorepo with Expo and NextJS. I used this repo as a starter GitHub - axeldelafosse/expo-next-monorepo-example: Create a universal React app using Expo and Next.js in a monorepo and so far it seems to be working really well in a dev environment. But when I tried to make a preview Android build, it failed with the following message:

> Task :app:bundleReleaseJsAndAssets FAILED
> Task :expo-modules-core:compileReleaseJavaWithJavac
[stderr] Note: Some input files use unchecked or unsafe operations.
[stderr] Note: Recompile with -Xlint:unchecked for details.
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.
[stderr] > A problem occurred starting process 'command '../../node_modules/hermes-engine/linux64-bin/hermesc''
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 52s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
244 actionable tasks: 244 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

I tried to reproduce the problem with the monorepo example without changing any code and it still fails.

Switching the jsEngine field to jsc on app.config.js seems to fix the issue and the build completes successfully, but I’m not sure how I can get more information on why the build fails with Hermes.

Is there anything else I can do to debug why the build fails on EAS service? Can we get more detailed logs about that or do I need to run the Turle CI locally and see if I get any different results?

Thanks for your help!

hey there! this appears to be due to the way react-native looks up hermes - it assumes that it will be located in the project node_modules and not noisted to the root. this commit allows us to work around it: [template] Fix hermes command not found on monorepo (#15154) · expo/expo@eb76b7b · GitHub

we’ll publish the change within the next hour

we’ve published the updated template package. to trigger a new EAS build should resolve the problem. thanks for reporting this issue to us.