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 needs to be disabled #153

Open
kawpuh opened this issue Jul 24, 2023 · 8 comments
Open

Hermes needs to be disabled #153

kawpuh opened this issue Jul 24, 2023 · 8 comments

Comments

@kawpuh
Copy link

kawpuh commented Jul 24, 2023

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.

@kawpuh kawpuh changed the title Hermes enabled by default Hermes needs to be disabled Jul 24, 2023
@jeisses
Copy link

jeisses commented Jul 26, 2023

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

@nsadeh
Copy link

nsadeh commented Jul 31, 2023

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?

@jeisses
Copy link

jeisses commented Jul 31, 2023

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

@nsadeh
Copy link

nsadeh commented Jul 31, 2023 via email

@kawpuh
Copy link
Author

kawpuh commented Aug 1, 2023

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

@kawpuh
Copy link
Author

kawpuh commented Nov 28, 2023

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.

@hadils
Copy link

hadils commented Aug 5, 2024

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?

@kawpuh
Copy link
Author

kawpuh commented Sep 20, 2024

From the slack

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

No branches or pull requests

4 participants