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.

React Native: React DevTools fails to load component info when using Hermes

See original GitHub issue

🐛 Bug Report

It seems like whenever Hermes is enabled and I try to view component info in the React DevTools plugin against an Android emulator, it fails

To Reproduce

$ npx react-native init MyApp --template react-native-template-typescript

Set enableHermes: true in android/app/build.gradle

$ rm -rf node_modules && yarn
$ yarn start
$ yarn android

Launch Flipper and go to the React DevTools plugin Click on any component in the DevTools component tree and the right panel gets stuck on “Loading…” (the terminal output of yarn start shows eg:

[Sat Feb 06 2021 13:17:11.801]  LOG      [React DevTools] Error calling listener {"event": "inspectElement", "payload": {"id": 19, "rendererID": 1}}
[Sat Feb 06 2021 13:17:11.807]  LOG      error: [TypeError: undefined is not a function]
[Sat Feb 06 2021 13:17:11.811]  ERROR    [TypeError: undefined is not a function]

Environment

Flipper version 0.74.0 MacOS 10.15.7 Android emulator running Android R (Android 11.0, API level 30) Fresh react-native-template-typescript install (react@16.13.1, react-native@0.63.4)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
thiagocbarretocommented, Feb 27, 2021

Same problem here (Flipper 0.78.0), but I’m not using Hermes in any way. I’m on Ubuntu 18.04, running the app on a physical android device.

Flipper flipper-image

App app-image

Terminal Logs

[Sat Feb 27 2021 15:07:48.392]  LOG      [React DevTools] Error calling listener {"event": "inspectElement", "payload": {"id": 516, "rendererID": 1}}
[Sat Feb 27 2021 15:07:48.400]  LOG      error: [TypeError: undefined is not a function]
[Sat Feb 27 2021 15:07:48.402]  ERROR    [TypeError: undefined is not a function]
1reaction
helixbasscommented, Feb 23, 2021

No this is still happening when using Flipper v0.76.0

Fwiw I also see this when I run standalone react-devtools v4.10.1-3a8c04e3b2 (outside of Flipper) so this may be an issue with React DevTools rather than Flipper itself?

My “workaround” has been if I want to use React DevTools I temporarily turn off Hermes (so eg per the docs, set enableHermes: false in android/app/build.gradle, run ./gradlew clean from android/ directory, and relaunch the app)

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Using Hermes in React Native - LogRocket Blog
Add Hermes, an open-source JavaScript engine, to your React Native application to optimize performance by reducing app launch time.
Read more >
React Native (Android) - Failed to transform hermes-debug.aar
Update: The error still occur after I edited package.json and use npm install to add hermes-engine . Here are the errors: npm WARN...
Read more >
Troubleshooting | React Navigation
Sometimes it might even be due to a corrupt installation. If clearing cache didn't work, try deleting your node_modules folder and run npm...
Read more >
Strict Mode - React
StrictMode currently helps with: Identifying components with unsafe lifecycles; Warning about legacy string ref API usage; Warning about deprecated findDOMNode ...
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