Skip to content

Hermes needs to be disabled #153

Open

Description

@kawpuh

In newer version of react native, Hermes is enabled by default which will result in errors like the following:

 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/dom/tagname.js [SyntaxError: 9:20:Invalid expression encountered]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/html/safescript.js [SyntaxError: 14:1:invalid statement encountered.]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/html/trustedresourceurl.js [SyntaxError: 17:32:Invalid expression encountered]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/html/safeurl.js [SyntaxError: 16:21:Invalid expression encountered]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/html/safestyle.js [SyntaxError: 14:23:Invalid expression encountered]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/html/safestylesheet.js [SyntaxError: 17:1:invalid statement encountered.]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/html/safehtml.js [SyntaxError: 25:22:Invalid expression encountered]
 ERROR  Could not evaluate http://192.168.1.241:8081/target/goog/math/long.js [SyntaxError: 11:1:invalid statement encountered.]

I suggest making a note of this and adding a link to these instructions in the reagent tutorial.

Activity

  1. changed the title [-]Hermes enabled by default[/-] [+]Hermes needs to be disabled[/+] on Jul 24, 2023
  2. jeisses commented on Jul 26, 2023

    @jeisses

    I ran into the same issue, and disabling Hermes solved it for me as well. Thanks for sharing this 👍

    When using advanced compilation it is possible to enable Hermes again

  3. nsadeh commented on Jul 31, 2023

    @nsadeh

    It should be possible to define :language-out :es5 for the compiler so that this isn't an issue. @jeisses how do you re-enable hermes for advanced compilation? Manually?

  4. jeisses commented on Jul 31, 2023

    @jeisses

    Yes manually, which is not great.
    I also switched to setting :language-out :es5 which is more convenient. Wonder if there are any downsides with switching to es5

  5. nsadeh commented on Jul 31, 2023

    @nsadeh
  6. kawpuh commented on Aug 1, 2023

    @kawpuh
    Author

    At least for android, instead of manually switching you could add --extra-params=-PhermesEnabled=false to your npx react-native run-android command for debug builds. You can read more about it here. It seems to take precedence over the hermesEnabled property in gradle.properties

  7. kawpuh commented on Nov 28, 2023

    @kawpuh
    Author

    I've seen talk of adding :language-out :es5 to build.edn as an alternative, but this doesn't seem to work for me. If anyone has an alternative work around for using hermes with krell debug builds it would be nice to know as react-native-reanimated has problems with JSC.
    EDIT:
    It seems to be an issue with re-frame-http-fx in particular. If you're not using this library you may be able to get by with just adding :language-out :es5 to build.edn and removing your target folder before recompiling.

  8. hadils commented on Aug 5, 2024

    @hadils

    Ok. :language-out :es5 works not with Hermes, except for this:

     ERROR  Could not evaluate http://192.168.0.190:8081/target/goog/net/xhrio.js [TypeError: Cannot read property 'getLogger' of undefined]```
     
     This is because there are exclamation marks in the variable names in this file. How do I solve this problem?
    
  9. kawpuh commented on Sep 20, 2024

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions