VS Code Debug React

31 views Asked by At

I have a React app being served by Express. The code runs on a VM and I connect VS Code via ssh to the code folder on the VM.

I am trying to figure out how to debug the app in Chrome from VS Code debugger.

I have started Chrome from my Mac with --remote-debugging-port=9222.

I navigate to the React app running at http://vm_url:3009 in the Chrome browser and then I try to attach VS Code debugger to it with this config:

{
            "name": "RE-Landing",
            "type": "chrome",
            "request": "attach",
            "webRoot": "${workspaceFolder}",
            "urlFilter": "http://my_vm_url:3009/*",
            "sourceMaps": true,
            "port": 9222,
            "timeout": 30000
          }

The debugger times out trying to connect to the Chrome browser running my app.

0

There are 0 answers