question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

in WSL linux configuration is used instead of windows

See original GitHub issue

Describe the bug We have a launch config for Chromium and have specified per OS runtime executables. After the VS Code update to 1.47 the linux config is used on WSL instead of the windows one and errors with this message

Unable to launch browser: "Unable to find Chrome version /usr/bin/chromium. Available auto-discovered versions are: ["dev"]. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable."

When I disable the extension in the settings it again works as before.

To Reproduce

{
   "trace": "verbose",
   "type": "chrome",
   "request": "launch",
   "name": "debug:frontend",
   "url": "http://localhost:4200/#",
   "webRoot": "${workspaceFolder}/frontend",
   "sourceMapPathOverrides": {
      "webpack:/*": "${webRoot}/*",
      "/./*": "${webRoot}/*",
      "/src/*": "${webRoot}/*",
      "/*": "*",
      "/./~/*": "${webRoot}/node_modules/*"
   },
   "windows": {
      "runtimeExecutable": "${env:USERPROFILE}/AppData/Local/Chromium/Application/chrome.exe"
   },
   "linux": {
      "runtimeExecutable": "/usr/bin/chromium",
      "runtimeArgs": [
         "--new-window",
         "-user-data-dir=\"/${workspaceFolder}/DevProfile\"",
         "--remote-debugging-port=9222",
         "--disable-background-networking"
      ]
   }
}

Log File

{"timestamp":1594636520567,"tag":"runtime.welcome","level":1,"message":"js-debug v1.47.3 started","metadata":{"os":"linux x64","nodeVersion":"v12.4.0","adapterVersion":"1.47.3"}}
{"tag":"dap.receive","timestamp":1594636520430,"metadata":{"connectionId":0,"message":{"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"pwa-chrome","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"de","supportsProgressReporting":true},"type":"request","seq":1}},"level":0}
{"tag":"dap.send","timestamp":1594636520431,"metadata":{"connectionId":0,"message":{"seq":1,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"exceptionBreakpointFilters":[{"filter":"caught","label":"Caught Exceptions","default":false},{"filter":"uncaught","label":"Uncaught Exceptions","default":false}],"supportsStepBack":false,"supportsSetVariable":true,"supportsRestartFrame":true,"supportsGotoTargetsRequest":false,"supportsStepInTargetsRequest":false,"supportsCompletionsRequest":true,"supportsModulesRequest":false,"additionalModuleColumns":[],"supportedChecksumAlgorithms":[],"supportsRestartRequest":true,"supportsExceptionOptions":false,"supportsValueFormattingOptions":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":false,"supportsDelayedStackTraceLoading":true,"supportsLoadedSourcesRequest":true,"supportsLogPoints":true,"supportsTerminateThreadsRequest":false,"supportsSetExpression":false,"supportsTerminateRequest":false,"completionTriggerCharacters":[".","[","\"","'"],"supportsBreakpointLocationsRequest":true,"supportsClipboardContext":true}}},"level":0}
{"tag":"dap.send","timestamp":1594636520432,"metadata":{"connectionId":0,"message":{"seq":2,"type":"event","event":"initialized","body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1594636520547,"metadata":{"connectionId":0,"message":{"command":"launch","arguments":{"trace":true,"type":"pwa-chrome","request":"launch","name":"debug:frontend","url":"http://localhost:4200/#","webRoot":"/__vscode-remote-uri__/home/tao/projects/x/gui/frontend","sourceMapPathOverrides":{"webpack:/*":"${webRoot}/*","/./*":"${webRoot}/*","/src/*":"${webRoot}/*","/*":"*","/./~/*":"${webRoot}/node_modules/*"},"remoteAuthority":"wsl+ubuntu-20.04","__workspaceFolder":"\\home\\tao\\projects\\x\\gui","runtimeExecutable":"/usr/bin/chromium","runtimeArgs":["--new-window","-user-data-dir=\"//__vscode-remote-uri__/home/tao/projects/x/gui/DevProfile\"","--remote-debugging-port=9222","--disable-background-networking"],"__sessionId":"fc45e213-184f-4181-863c-0d037ac28df1"},"type":"request","seq":2}},"level":0}
{"tag":"dap.send","timestamp":1594636520549,"metadata":{"connectionId":0,"message":{"seq":3,"type":"event","event":"output","body":{"category":"telemetry","output":"js-debug/launch","data":{"type":"pwa-chrome","request":"launch","os":"linux x64","nodeVersion":"v12.4.0","adapterVersion":"1.47.3","parameters":"{\"type\":\"pwa-chrome\",\"name\":\"<string>\",\"request\":\"launch\",\"trace\":true,\"outputCapture\":\"console\",\"timeout\":10000,\"showAsyncStacks\":true,\"skipFiles\":[],\"smartStep\":true,\"sourceMaps\":true,\"pauseForSourceMap\":true,\"resolveSourceMapLocations\":null,\"rootPath\":\"<string>\",\"outFiles\":[\"<string>\",\"<string>\"],\"sourceMapPathOverrides\":{\"webpack:/*\":\"<string>\",\"/./*\":\"<string>\",\"/src/*\":\"<string>\",\"/*\":\"<string>\",\"/./~/*\":\"<string>\"},\"__workspaceFolder\":\"<string>\",\"__autoExpandGetters\":false,\"address\":\"localhost\",\"port\":0,\"disableNetworkCache\":true,\"pathMapping\":{},\"url\":\"<string>\",\"restart\":false,\"urlFilter\":\"\",\"webRoot\":\"<string>\",\"server\":null,\"targetSelection\":\"automatic\",\"vueComponentPaths\":[\"<string>\",\"<string>\"],\"cwd\":null,\"file\":null,\"env\":{},\"includeDefaultArgs\":true,\"runtimeArgs\":[\"<string>\",\"<string>\",\"<string>\",\"<string>\"],\"runtimeExecutable\":\"<string>\",\"userDataDir\":true,\"browserLaunchLocation\":\"workspace\",\"profileStartup\":false,\"cleanUp\":\"wholeBrowser\",\"remoteAuthority\":\"<string>\",\"__sessionId\":\"<string>\"}"}}}},"level":0}
{"tag":"dap.send","timestamp":1594636520552,"metadata":{"connectionId":0,"message":{"seq":4,"type":"event","event":"output","body":{"category":"console","output":"Verbose logs are written to:\n/tmp/vscode-debugadapter-0.json.gz\n"}}},"level":0}
{"tag":"dap.receive","timestamp":1594636520568,"metadata":{"connectionId":0,"message":{"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":3}},"level":0}
{"tag":"dap.send","timestamp":1594636520568,"metadata":{"connectionId":0,"message":{"seq":5,"type":"response","request_seq":3,"command":"setExceptionBreakpoints","success":true,"body":{}}},"level":0}
{"tag":"runtime.launch","timestamp":1594636521024,"message":"Launch returned error","metadata":{"error":{"message":"Unable to launch browser: \"Unable to find Chrome version /usr/bin/chromium. Available auto-discovered versions are: [\"dev\"]. You can set the \"runtimeExecutable\" in your launch.json to one of these, or provide an absolute path to the browser executable.\"","stack":"Error: Unable to launch browser: \"Unable to find Chrome version /usr/bin/chromium. Available auto-discovered versions are: [\"dev\"]. You can set the \"runtimeExecutable\" in your launch.json to one of these, or provide an absolute path to the browser executable.\"\n\tat f.prepareLaunch (/home/tao/.vscode-server/bin/d5e9aa0227e057a60c82568bf31c04730dc15dcd/extensions/ms-vscode.js-debug/src/extension.js:15:2618858)"},"wasCancelled":false,"name":"f"},"level":2}
{"tag":"dap.send","timestamp":1594636521030,"metadata":{"connectionId":0,"message":{"seq":6,"type":"response","request_seq":2,"command":"launch","success":false,"body":{"error":{"id":9240,"format":"Unable to launch browser: \"Unable to find Chrome version /usr/bin/chromium. Available auto-discovered versions are: [\"dev\"]. You can set the \"runtimeExecutable\" in your launch.json to one of these, or provide an absolute path to the browser executable.\"","showUser":false}}}},"level":0}
{"tag":"dap.receive","timestamp":1594636521073,"metadata":{"connectionId":0,"message":{"command":"configurationDone","type":"request","seq":4}},"level":0}
{"tag":"dap.send","timestamp":1594636521074,"metadata":{"connectionId":0,"message":{"seq":7,"type":"response","request_seq":4,"command":"configurationDone","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1594636521082,"metadata":{"connectionId":0,"message":{"command":"disconnect","arguments":{"restart":false},"type":"request","seq":5}},"level":0}
{"tag":"dap.send","timestamp":1594636521084,"metadata":{"connectionId":0,"message":{"seq":8,"type":"response","request_seq":5,"command":"disconnect","success":true,"body":{}}},"level":0}
{"tag":"dap.send","timestamp":1594636526085,"metadata":{"connectionId":0,"message":{"seq":9,"type":"event","event":"output","body":{"category":"telemetry","output":"js-debug/dap/operation","data":{"errors":[],"disconnect":{"operation":"disconnect","totalTime":2.2,"max":2.2,"avg":2.2,"stddev":null,"count":1,"failed":0},"!disconnect.errors":[]}}}},"level":0}

VS Code Version: 1.47

Additional context Windows 10 2004 Build 19041.329 WSL 2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
connor4312commented, Jul 20, 2020

Ah, yes. I could also move pwa-chrome to be resolved by the companion extension rather than js-debug itself. It’s an extraneous activation, but the companion is quite a lightweight and small extension.

0reactions
weinandcommented, Jul 20, 2020

@connor4312 Resolving launch config variables is done in the extension host where the debug extension is running.

Since the “chrome” debug extension was changed from being a “UI” extension to a “workspace” extension, it now runs in the “remote” extension host for remote setups. This is a breaking change.

A non-breaking strategy would be to keep the new “chrome” debugger as a UI extension and introduce some new mechanism for optionally running it in the remote extension host. One cheap way to achieve this is by having two debug extensions, “chrome” and “pwa-chrome”, where the former is the old UI extension and the latter the new workspace extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced settings configuration in WSL - Microsoft Learn
A guide to the wsl.conf and .wslconfig files used for configuring settings when running multiple Linux distributions on Windows Subsystem ...
Read more >
FAQ's about Windows Subsystem for Linux - WSL
Why would I use WSL rather than Linux in a VM? WSL requires fewer resources (CPU, memory, ... This setup is different than...
Read more >
Set up a WSL development environment - Microsoft Learn
Set up a WSL development environment using best practices from this set-by-step guide. Learn how to run Ubuntu, Visual Studio Code or Visual ......
Read more >
What is Windows Subsystem for Linux | Microsoft Learn
The Windows Subsystem for Linux lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- ...
Read more >
Install Linux on Windows with WSL - Microsoft Learn
Install Windows Subsystem for Linux with the command, wsl --install. Use a Bash terminal on your Windows machine run by your preferred Linux...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found