0

I found this article: Problem to run chrome debugger in VS Code

I followed the answer there and set up the following in my launch.json:

      {
        "name": "Launch Chrome",
        "request": "launch",
        "type": "pwa-chrome",
        "url": "https://localhost:44444/health/status",
        "webRoot": "${workspaceFolder}/public",
        "runtimeExecutable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
      }

The problem is that when I just run that "Launch Chrome" option, it opens Chrome correctly but my project / server hasn't started yet. What I really need to do is when I press F5 to debug my project, I'd like the system to start iis express, load my server project and then open chrome with all the cache cleaned up.

So I tried to change this:

            "launchBrowser": {
              "enabled": true,
              "args": "${auto-detect-url}",
              "windows": {
                  "command": "cmd.exe",
                  "args": "/C start ${auto-detect-url}"
              },
          "osx": {
              "command": "open"
          },
              "linux": {
                  "command": "xdg-open"
              }
          }

to this:

            "launchBrowser": {
              "enabled": true,
              "args": "${auto-detect-url}",
              "windows": {
                  "command": "cmd.exe",
                  "args": "/C start ${auto-detect-url}"
              },
              "osx": {
                  "command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
              },
              "linux": {
                  "command": "xdg-open"
              }
          }

but I get the following errors in my debug console:

crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.
chromewebdata/(index)꞉6549:22:6774
crbug/1173575, non-JS module files deprecated.

I've also tried to update settings.json but I don't know what values to specify:

"debug.javascript.defaultRuntimeExecutable": {

"pwa-chrome": "",
    "pwa-node": "node"
}
dot
  • 14,928
  • 41
  • 110
  • 218

1 Answers1

0

I was able to get my swagger page to open in Chrome on OSX by default using this launchBrowser config.

"launchBrowser": {
    "enabled": true,
    "args": "${auto-detect-url}",
    "windows": {
        "command": "cmd.exe",
        "args": "/C start ${auto-detect-url}/swagger"
    },
    "osx": {
        "command": "open",
        "args": "${auto-detect-url}/swagger"
    },
    "linux": {
        "command": "xdg-open"
    }
},

The OSX Chrome arg should just be the desired launch URL.

Word of warning: It seems that, with this configuration, when I stop debugging, Chrome is completely closed.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83