diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp index d12832d1cba400..f3a215c622089a 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp @@ -153,6 +153,11 @@ std::unique_ptr HermesInstance::createJSRuntime( std::unique_ptr hermesRuntime = hermes::makeHermesRuntime(runtimeConfigBuilder.build()); + auto errorPrototype = hermesRuntime->global() + .getPropertyAsObject(*hermesRuntime, "Error") + .getPropertyAsObject(*hermesRuntime, "prototype"); + errorPrototype.setProperty(*hermesRuntime, "jsEngine", "hermes"); + #ifdef HERMES_ENABLE_DEBUGGER auto& inspectorFlags = jsinspector_modern::InspectorFlags::getInstance(); if (!inspectorFlags.getFuseboxEnabled()) {