fix: support hermes-compiler path for React Native 0.83+#115
Open
haiquang9994 wants to merge 1 commit into
Open
fix: support hermes-compiler path for React Native 0.83+#115haiquang9994 wants to merge 1 commit into
haiquang9994 wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
code-push release-reactfails withENOENT: spawn node_modules/hermesvm/osx-bin/hermeson React Native 0.83+ projects.React Native 0.83+ removed
node_modules/react-native/sdks/hermescand moved Hermes to a standalonehermes-compilernpm package with a different path structure.Root Cause
getHermesCommand()insrc/lib/react-native-utils.tschecks paths in this order:node_modules/react-native/sdks/hermesc/<OS-BIN>/hermesc— removed in RN 0.83+node_modules/hermes-engine/<OS-BIN>/hermesc— older RNnode_modules/hermesvm/<OS-BIN>/hermes— does not exist in RN 0.83+, causing ENOENTFix
Add a check for the
hermes-compilerpackage path before falling back tohermesvm:Test
Tested on a React Native 0.85.3 project —
code-push release-reactnow correctly finds and useshermes-compilerfor bytecode compilation.