Cannot convert undefined value to object, js engine: hermes
See original GitHub issueSetting enableHermes
to true
would cause Cannot convert undefined value to object, js engine: hermes
.
Confirmed it by setting the value to false
and rebuilding.
React Native version: System: OS: Linux 5.0 Antergos Linux undefined CPU: (8) x64 Intel® Core™ i7-2600 CPU @ 3.40GHz Memory: 2.91 GB / 7.77 GB Shell: 5.7.1 - /usr/bin/zsh Binaries: Node: 11.14.0 - /usr/bin/node Yarn: 1.16.0 - /usr/bin/yarn npm: 6.9.0 - /usr/bin/npm SDKs: Android SDK: API Levels: 28 Build Tools: 28.0.3 IDEs: Android Studio: 3.3 npmPackages: react: 16.8.6 => 16.8.6 react-native: 0.60.3 => 0.60.3
Steps To Reproduce
- Follow upgrade guide from
0.60.0
to0.60.3
- enable
enableHermes
inapp/build.gradle
./gradlew clean
react-native run-android
Describe what you expected to happen: Should work just fine as before.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Cannot convert undefined value to object, js engine: hermes ...
I redownloaded node modlues and nothing have changed. const Stack = createStackNavigator(); const Tab = createBottomTabNavigator();. When I ...
Read more >Cannot convert undefined or null to Object in JavaScript
The "Cannot convert undefined or null to Object" error occurs when we pass a null or an undefined value to a function that...
Read more >Using Hermes - React Native
Hermes is an open-source JavaScript engine optimized for React Native. For many apps, using Hermes will result in improved start-up time, ...
Read more >typeerror: cannot convert undefined or null to object - You.com
So if you pass the actual null value to your script, it will be parsed in the Object part of the code. And...
Read more >8 Practices In React that will Crash your application - Morioh
"TypeError: Cannot convert undefined or null to object at Function.keys ... You can simply just initialize a value to an empty array if...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hackdie this is probably not a Hermes-related error but rather a normal JS error. The string
js engine: hermes
is there just to inform you that you’ve enabled Hermes correctly, and is not part of the actual error text. But it can be confusing at first.If debugging in chrome doesn’t yield an answer, there is a blunt way of debugging this: try doing a binary search on your components (meaning, comment half of them out, see if the error is there, if not, comment the other half out, etc.) to pinpoint where this originates. It’s possible that you are just passing an
undefined
where an object is expected.There might be something that makes Hermes more susceptible to this issue (which would give the perception of being caused by Hermes), but I don’t know the internals, just a thought.
@xxRockOnxx Try debugging JS in Chrome debugger and enable „Pause on exceptions”. This way you should be able to at least see where the problem originates. It would be good to have a minimal reproducible example to work with.
I had the same issue but it turned out that it wasn’t actually Hermes (actually it was Reactotron trying to notify me of subscriptions to an incorrectly configured Redux store). I’m mentioning this because I also though that disabling Hermes fixed the issue, but it was only coincidentally related and stateful.