skip to Main Content

I am using Flipper to check the performance issue for a React Native project. Whenever I am selecting the React DevTools option, I am getting error on the iOS simulator. Attached screenshot for reference.enter image description here I want to check the load time for components.

My React Native version is 0.63.4. I am unsure if I need to install package for dev tools.

I found following error in Flipper which says Failed to find globally installed React DevTools

enter image description here

Help me.

2

Answers


  1. It is failing because you are trying to use an object provided by the browser. React Native is running Javascript code in a different environment than the browser and this environment don’t have a window, thus window is an undefined object.

    Usually, some elements of the window are pollyfield to empty values, to avoid some packages to break.

    Somewhere in your code, you are trying to create an element using window.document.createElement(), or document.createElement(), which is unavailable.

    Try to remove that part and test again.

    Login or Signup to reply.
  2. The github issue has some more movement: https://github.com/facebook/flipper/issues/4046

    Steps to upgrade the Flipper built in reactDevTools:

    1. npx i -g react-devtools react-devtools-inline
    2. Then a use global devtools toggle should appear in the Flipper -> React DevTools area and the failed to find globally installed React devTools should also be gone.

    Credit goes to answers in the linked github issue.

    If like me you are also running into a situation where the app crashes with createElement error : ERROR TypeError: Cannot read property 'createElement' of undefined, js engine: hermes
    then => turn off Highlight on component update in Flipper: https://github.com/facebook/flipper/issues/4131

    Lastly RN apps start crashing on boot up when run on their own after using Flipper, this is a known issue: https://github.com/facebook/flipper/issues/3284

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search