Guides
Plan-enterprise-icon
Expo Application Services
API Reference

Using Hermes Engine

Hermes is a JavaScript engine optimized for React Native. By compiling JavaScript into bytecode ahead of time, Hermes can improve your app start-up time. The binary size of Hermes is also smaller than other JavaScript engines, such as JavaScriptCore (JSC). It also uses less memory at runtime, which is particularly valuable on lower-end Android devices.

Support

The Hermes engine is fully supported across all Expo tooling. See the table below to check if your project is using a compatible version:
PlatformExpo GoDevelopment Builds
AndroidSDK 42SDK 42
iOSSDK 47SDK 43

Setup

To get started, open your app.json and add the jsEngine field:
{
  "expo": {
    "jsEngine": "hermes"
  }
}
Development builds will need to be recompiled with eas build.

Switch JavaScript engine on a specific platform

You may want to use Hermes on one platform and JSC on another. One way to do this is to set the "jsEngine" to "hermes" at the top level and then override it with "jsc" under the "ios" key. You may alternatively prefer to explicitly set "hermes" on just the "android" key in this case.
{
  "expo": {
    "jsEngine": "hermes",
    "ios": {
      "jsEngine": "jsc"
    }
  }
}

Publish updates

Publishing updates with eas update and npx expo export will generate Hermes bytecode bundles and their source maps.
Please note that the Hermes bytecode format may change between different Hermes versions — an update produced for a specific version of Hermes will not run on a different version of Hermes. Starting from Expo SDK 46 (React Native 0.69), Hermes is bundled within React Native. Updating React Native version or Hermes version can be thought of in the same way as updating any other native module. So if you update the react-native version you should also update the runtimeVersion in app.json. If you don't do this, your app may crash on launch because the update may be loaded by an existing binary that uses an older Hermes version that is incompatible with the updated bytecode format. See "runtimeVersion" for more information.

JavaScript debugger

To debug JavaScript code running with Hermes, you can start your project with npx expo start then press j to open the debugger in Google Chrome or Microsoft Edge. The developer menu of Expo Go or development builds also has the Open JS Debugger option to do the same.
Alternatively, you can use the JavaScript inspector from the following tools:

Troubleshooting

Warning-icon
No compatible apps connected. JavaScript Debugging can only be used with the Hermes engine. when opening the debugger.
  • If your app is built by eas build, npx expo run:android or npx expo run:ios, make sure it is debug build.
  • Internally, the app will establish a WebSocket connection, make sure your app is connected to the development server.
    • Try to reload the app by pressing r in the Expo CLI Terminal UI.
    • Test debugging availability by running the command: curl http://127.0.0.1:19000/json/list (adjust the 127.0.0.1:19000 to match your dev server URL). The HTTP response should not be an empty array, but rather something like this:
    [
      {
        "id": "0-2",
        "description": "host.exp.Exponent",
        "title": "Hermes ABI47_0_0React Native",
        "faviconUrl": "https://reactjs.org/favicon.ico",
        "devtoolsFrontendUrl": "devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=%5B%3A%3A1%5D%3A19000%2Finspector%2Fdebug%3Fdevice%3D0%26page%3D2",
        "type": "node",
        "webSocketDebuggerUrl": "ws://[::1]:19000/inspector/debug?device=0&page=2",
        "vm": "Hermes"
      },
      {
        "id": "0--1",
        "description": "host.exp.Exponent",
        "title": "React Native Experimental (Improved Chrome Reloads)",
        "faviconUrl": "https://reactjs.org/favicon.ico",
        "devtoolsFrontendUrl": "devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=%5B%3A%3A1%5D%3A19000%2Finspector%2Fdebug%3Fdevice%3D0%26page%3D-1",
        "type": "node",
        "webSocketDebuggerUrl": "ws://[::1]:19000/inspector/debug?device=0&page=-1",
        "vm": "don't use"
      }
    ]
    

Can I use Remote Debugging with Hermes?

One of the many limitations of remote debugging is that it does not work with modules built on top of JSI. For example, if your app uses react-native-reanimated version 2 or higher, remote debugging will not work.
Hermes supports Chrome DevTools Protocol to debug JavaScript in place by connecting to the running engine on the device. This enables you to debug your app even when using JSI modules. This debugging technique is superior to remote debugging and replaces it for apps using Hermes.
  • Message-iconAsk a question on the forums
  • Edit-iconEdit this page

Was this doc helpful?