Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hermes is always disabled #2288

Open
DanielSRS opened this issue Nov 20, 2024 · 3 comments
Open

Hermes is always disabled #2288

DanielSRS opened this issue Nov 20, 2024 · 3 comments
Labels
bug Something isn't working Needs: Triage 🔍

Comments

@DanielSRS
Copy link

Environment

react-native -v: 0.75.4
npm ls react-native-macos: 0.75.15
node -v: 21.7.1
npm -v: 10.5.0
yarn --version: 4.5.1
xcodebuild -version: 15.4

Steps to reproduce the bug

Not exactly sure if this is a bug or intended, But I can't enable Hermes by just running USE_HERMES=1 pod install as suggested here (since the docs site seems outdated) because in Podfile:

:hermes_enabled => false

I'm unaware if there is any problem with Hermes on MacOS that motivated this, I was just testing DevTools and Hermes is needed for that.

Expected Behavior

just run USE_HERMES=1 pod install to enable Hermes

Actual Behavior

running USE_HERMES=1 pod install does nothing

Reproducible Demo

To reproduce:

  • run npx react-native-macos-init to add macos to a RN project
  • run cd macos && USE_HERMES=1 pod install

Additional context

I just updated the Podfile to:

use_react_native!(
    :path => '../node_modules/react-native-macos',
-   :hermes_enabled => false
+   :hermes_enabled => ENV['USE_HERMES'] == '1',
    :fabric_enabled => ENV['RCT_NEW_ARCH_ENABLED'] == '1',
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

And all the related pods seems to be installed correctly and build and running worked without any issues so far.

If the template is intended to be like this, feel free to close it right away.

@DanielSRS DanielSRS added the bug Something isn't working label Nov 20, 2024
@bear-ei
Copy link

bear-ei commented Nov 21, 2024

In version 0.75.0, you can temporarily modify :hermes_enabled => false to :hermes_enabled => true, and then run pod install to enable Hermes.

@DanielSRS
Copy link
Author

Yes, you're right, I was also wondering if it might be worth updating the template to simply check the env.

I think this would be more suitable to open as an discussion rather than a issue, but its not available in this repo.

@bear-ei
Copy link

bear-ei commented Dec 10, 2024

Yes, you're right, I was also wondering if it might be worth updating the template to simply check the env.

I think this would be more suitable to open as an discussion rather than a issue, but its not available in this repo.

I believe that using USE_HERMES=1 pod install is the correct approach. However, for versions 0.75.0 to 0.76.0 at least, if you do not use :hermes_enabled => true, then every time you need to update the pods, you must add the USE_HERMES=1 instruction. It seems that the environment variable does not properly persist the USE_HERMES setting. Currently, using :hermes_enabled => true should only be a temporary measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

2 participants