Site cannot be reached with Visual Studio Code Chrome debugger

0

I'm coming from WebStorm and I'm using 10% of it. I like how Visual Studio Code looks and the integration for TypeScript is very good. So I decided to try it.

I want to debug my index.html that requests js + js.map files.

My debug configuration in Visual Studio Code is:

{
    "type": "chrome",
    "request": "launch",
    "name": "Launch Chrome against localhost",
    "url": "http://localhost:8080", // url that will typed when auto launch chrome?
    "webRoot": "${workspaceFolder}" // the folder where vscode local server will be started?
}

I don't want to attach a debugger to some processes, don't want to start additional live-server or something.

From the explanation in the chrome debug docs, I understand that it starts its own local server internally. How can WebStorm do it?

Is it true ? And how can I achieve the same behaviour with Visual Studio Code?

My project(root) contains:

  • bin
    • index.html
    • spritesheet.png
    • app.js
    • app.js.map
    • lib.js
  • src
    • Main.ts
  • package.json
  • node_modules.// index.html using files from node_modules

In WebStorm I press debug index.html on the index.html files and it creates debug configuration which can start local server in ./bin. Also somehow the server resolves requests like ../node_modules. I don't care if the server is started in the root or root/bin.

Александър К.

Posted 2019-04-19T22:28:07.950

Reputation: 1

No answers