EAS build fails when using hermes (android)

EAS build fails only when hermes is enabled in my app.

[stderr] /home/expo/workingdir/build/android/app/build/generated/assets/react/release/index.android.bundle:182810:9: error: Invalid regular expression: Quantifier has nothing to repeat
[stderr]     N = /^((?<protocol>http[s]?):\/\/)?(?<host>localhost)(:(?<port>\d+))?$/;

There is an related issue in facebook hermes repo. It looks like hermes has issues with regex see here.

In your post, please share:

  • managed workflow
  • eas-cli/2.7.1 darwin-arm64 node-v14.18.1
  • What you have tried so far: Searched related issues

what react-native version are you using? what code reproduces this?

@brents, thank you for the reply.
"expo": "^47.0.0",
"react-native": "0.70.5",

I’m not sure how to reproduce this issue. I’m using the nhost graphql library in my app. There is a similar open issue in their repo (nhostreact0.14.2 breaks my Expo React Native (Hermes) app · Issue #1160 · nhost/nhost · GitHub). This may give you more insight. The issue might be on Hermes side or on Nhost side, not sure. In any case thank you for any help or suggestion.

1 Like

@brents FWIW I solved the issue by upgrading to latest version of @nhost/nhost-js (they fixed the regex bug) and by using the babel plugin @babel/plugin-transform-named-capturing-groups-regex.

Thanks for having looked at this issue.


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