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:
- Created 3 years ago
- Reactions:10
- Comments:6 (1 by maintainers)
Top 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 >
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
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
App
Terminal Logs
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
inandroid/app/build.gradle
, run./gradlew clean
fromandroid/
directory, and relaunch the app)