Skip to content

Conversation

@kimchi-developer
Copy link
Contributor

@kimchi-developer kimchi-developer commented Feb 3, 2026

Summary

React Native 0.84 centralized the HERMES_V1_ENABLED define into target_compile_reactnative_options() in react-native-flags.cmake (commit).

When worklets defines -DHERMES_V1_ENABLED=${HERMES_V1_ENABLED} and then calls target_compile_reactnative_options(), the macro gets defined twice with different values (true vs 1), causing:

error: 'HERMES_V1_ENABLED' macro redefined [-Werror,-Wmacro-redefined]
   #define HERMES_V1_ENABLED true
<command line>:1:9: note: previous definition is here
   #define HERMES_V1_ENABLED 1

Requires

Solution

Only define HERMES_V1_ENABLED manually for RN < 84, since RN 84+ handles it via target_compile_reactnative_options().

Test plan

  • Tested with Expo SDK 55 canary + React Native 0.84.0-rc.4
  • Android build succeeds after this fix

React Native 0.84 centralized the HERMES_V1_ENABLED define into
target_compile_reactnative_options() in react-native-flags.cmake.

When worklets also defines -DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}
and then calls target_compile_reactnative_options(), the macro gets
defined twice with different values (true vs 1), causing:

  error: 'HERMES_V1_ENABLED' macro redefined [-Werror,-Wmacro-redefined]

This fix only defines HERMES_V1_ENABLED manually for RN < 84.
@kimchi-developer kimchi-developer force-pushed the fix/hermes-v1-macro-redefinition-rn84 branch from 5b6b267 to c4da159 Compare February 3, 2026 07:19
@tomekzaw tomekzaw requested a review from tjzel February 3, 2026 07:45
@tjzel
Copy link
Collaborator

tjzel commented Feb 3, 2026

Thanks for the PR, I can confirm that it works, just a bump to rc.4 is required in the repo. I'll make a PR. Could you confirm that nothing has to be done on iOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants