react-native icon indicating copy to clipboard operation
react-native copied to clipboard

ERROR TypeError: Cannot read property 'createElement' of undefined, js engine: hermes

Open 98rahul opened this issue 2 years ago • 6 comments

Description

migrate to current version of RN-0.71.1 using flipper enable hermes engine run the app

Version

0.71.1

Output of npx react-native info

ERROR TypeError: Cannot read property 'createElement' of undefined, js engine: hermes ERROR TypeError: Cannot read property 'createElement' of undefined, js engine: hermes ERROR TypeError: Cannot read property 'createElement' of undefined, js engine: hermes ERROR TypeError: Cannot read property 'createElement' of undefined, js engine: hermes

Steps to reproduce

migrate to current version of RN-0.71.1 using flipper enable hermes engine run the app

this is related to --->> path: node_modules/react-devtools-core/dist/backend.js function initialize() { canvas = window.document.createElement('canvas'); canvas.style.cssText = "\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1000000000;\n "; var root = window.document.documentElement; root.insertBefore(canvas, root.firstChild); } check here

Snack, code example, screenshot, or link to a repository

function initialize() { canvas = window.document.createElement('canvas'); // error found here canvas.style.cssText = "\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1000000000;\n "; var root = window.document.documentElement; root.insertBefore(canvas, root.firstChild); }

98rahul avatar Jan 25 '23 08:01 98rahul

@98rahul - Take a look at these. I believe this is a known issue with workaround. Try disabling "Highlight updates when components render"

  • https://github.com/facebook/flipper/issues/4046#issuecomment-1252790246
  • https://github.com/facebook/flipper/issues/4131

iBotPeaches avatar Feb 01 '23 00:02 iBotPeaches

@iBotPeaches i didn't find the supportsTraceUpdates in order to make it comment . can you specify the path as i go through the whole node_modules\react-devtools-core\dist\backend.js ..

98rahul avatar Feb 06 '23 09:02 98rahul

@98rahul - Sorry mate. I just found some links to try and help you. Best of luck.

iBotPeaches avatar Feb 06 '23 11:02 iBotPeaches

@iBotPeaches always welcome! but i'm using flipper to debug the RN-app ,as mmkv does not supporting on chrome to debug bcz of sync behaviour so, i'm unaware about how to Highlight updates when components render on flipper(it isn't available). i was expecting some code break around initialize function .

98rahul avatar Feb 06 '23 12:02 98rahul

Probably a duplicate of #26060 https://github.com/facebook/react/pull/26060

pcanthelou-pass avatar Apr 17 '23 14:04 pcanthelou-pass

image ignore the error log and enter profiler , uncheck this hightlight option work for me.

koeika avatar Jun 14 '23 10:06 koeika

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 12 '23 05:12 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Dec 19 '23 05:12 github-actions[bot]