question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot convert undefined value to object, js engine: hermes

See original GitHub issue

Setting 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

  1. Follow upgrade guide from 0.60.0 to 0.60.3
  2. enable enableHermes in app/build.gradle
  3. ./gradlew clean
  4. react-native run-android

Describe what you expected to happen: Should work just fine as before.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
rszalskicommented, Jul 23, 2019

having same error, any idea?

@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.

1reaction
rszalskicommented, Jul 18, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found