Jean Vidal
Jean Vidal

Reputation: 91

Error Debugging in VS Code: Cannot connect to the target at localhost:3000: could not find any debuggable target

I have an application with React on frontend and .Net Core on backend and i am trying to debug my react frontend, without extensions and attaching to the process, but i am getting the message error bellow:

Cannot connect to the target at localhost:3000: Could not connect to debug target at http:localhost:3000: Could not find any debuggable target.

I'm using this launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug FrontEnd",
            "port": 3000,
            "request": "attach",
            "type": "chrome",
            "webRoot": "${workspaceFolder}"
        },
        {
            "name": "Debug BackEnd",
            "type": "coreclr",
            "request": "attach"
        }
    ]
}

I start my frontend using npm start witch is basically react-scripts start.

Obs.: Iḿ using opera browser.

Upvotes: 7

Views: 10158

Answers (3)

SBI
SBI

Reputation: 766

Please look at my answer here.

The issue can be solved by setting environment variable DOTNET_USE_POLLING_FILE_WATCHER to true.

Upvotes: 1

Jean Vidal
Jean Vidal

Reputation: 91

I found a workaround. This problem only occurs when I run with sudo npm start. When running it with just npm start I got this message:

"Unhandled exception. System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached."

So I solved it increasing the fs.inotify.max_user_instances with this command:

echo fs.inotify.max_user_instances=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

I found this solution by the answer of @Creak . To see more details, click this link

Upvotes: 2

Hugo B. S. Benedicto
Hugo B. S. Benedicto

Reputation: 191

After a search, all I could found was this issue.

Although Opera is now based on Chromium, it's not possible to debug it using VSCode yet. Maybe someone can come with a kind of workaround for it.

Upvotes: 1

Related Questions