App crashes after selecting 'Debug Remote JS'

229 Views Asked by At

I am developing a React Native app (RN v0.64.3) and I'm trying to connect the debugger to it, but whenever I press 'Debug Remote JS', the app crashes with the following error:

In VSCode console:

...\AppName\node_modules\metro-hermes-compiler\src\emhermesc.js:81
          throw ex;
          ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:19000/debugger-ui' ]

On Android (both emulator and my phone):

enter image description here

1

There are 1 best solutions below

0
On

React Native Debugger built on top of Google Chrome and use V8 engine to compile JavaScript. Looking at stack traces, it seems like you're using Hermes Engine which is not compatible in some cases. Try to switch to JavaScriptCore or migrate to Flipper debugger - https://fbflipper.com/