You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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
Sorry I am new to clojurescript builds and haven’t figured out where to put that setting. I put that in build.edn but still get errors, is that the right place?
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
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.
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?
Activity
[-]Hermes enabled by default[/-][+]Hermes needs to be disabled[/+]jeisses commentedon 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 commentedon 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 commentedon Jul 31, 2023
Yes manually, which is not great.
I also switched to setting
:language-out :es5which is more convenient. Wonder if there are any downsides with switching toes5nsadeh commentedon Jul 31, 2023
kawpuh commentedon Aug 1, 2023
At least for android, instead of manually switching you could add
--extra-params=-PhermesEnabled=falseto yournpx react-native run-androidcommand for debug builds. You can read more about it here. It seems to take precedence over the hermesEnabled property in gradle.propertieskawpuh commentedon Nov 28, 2023
I've seen talk of adding
:language-out :es5to 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 :es5to build.edn and removing your target folder before recompiling.hadils commentedon Aug 5, 2024
Ok.
:language-out :es5works not with Hermes, except for this:kawpuh commentedon Sep 20, 2024
From the slack