Skip to content

fix: support hermes-compiler path for React Native 0.83+#115

Open
haiquang9994 wants to merge 1 commit into
shm-open:masterfrom
haiquang9994:fix/hermes-compiler-support-rn-0-83-plus
Open

fix: support hermes-compiler path for React Native 0.83+#115
haiquang9994 wants to merge 1 commit into
shm-open:masterfrom
haiquang9994:fix/hermes-compiler-support-rn-0-83-plus

Conversation

@haiquang9994
Copy link
Copy Markdown

Problem

code-push release-react fails with ENOENT: spawn node_modules/hermesvm/osx-bin/hermes on React Native 0.83+ projects.

React Native 0.83+ removed node_modules/react-native/sdks/hermesc and moved Hermes to a standalone hermes-compiler npm package with a different path structure.

Root Cause

getHermesCommand() in src/lib/react-native-utils.ts checks paths in this order:

  1. node_modules/react-native/sdks/hermesc/<OS-BIN>/hermesc — removed in RN 0.83+
  2. node_modules/hermes-engine/<OS-BIN>/hermesc — older RN
  3. Falls back to node_modules/hermesvm/<OS-BIN>/hermes — does not exist in RN 0.83+, causing ENOENT

Fix

Add a check for the hermes-compiler package path before falling back to hermesvm:

node_modules/hermes-compiler/hermesc/<OS-BIN>/hermesc

Test

Tested on a React Native 0.85.3 project — code-push release-react now correctly finds and uses hermes-compiler for bytecode compilation.

RN 0.83+ removed node_modules/react-native/sdks/hermesc and moved Hermes
to the hermes-compiler npm package. Without this fix, the CLI falls back
to hermesvm which no longer exists, causing ENOENT errors.

New path: node_modules/hermes-compiler/hermesc/<OS-BIN>/hermesc

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant