Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code + Debugger for Chrome node.js

I have installed the Debugger for Chrome extension 0.2.0 in VS Code but I can't seem to get the launch.json configuration right. I am using the trivial Express App boilerplace here. I have the chrome shortcut with --remote-debugging-port=9222. Everything works fine with the native "type": node configuration. The Express boilerplate runs with node ./bin/www and is visible in chrome at http://localhost:3000 for context. I am looking for a "request": launch entry that works like the boilerplate "name": "Launch" "type": "node" configuration. That is, launches Chrome and displays the web page so I can set client breakpoints.

My launch.json entry for chrome is the following.

    {
        "name": "Launch localhost with sourcemaps",
        "type": "chrome",
        "request": "launch",
        "url": "http://localhost",
        "webRoot": "./bin",
        "sourceMaps": true
    }       
like image 226
Ken Avatar asked Dec 12 '15 00:12

Ken


1 Answers

I'm the developer for this extension. From the info you've given, you'll need to set "url" to "http:localhost:3000" and probably "webRoot" to "./bin/www". Then let me know if you still have issues.

like image 136
Rob Lourens Avatar answered Sep 25 '22 14:09

Rob Lourens