Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unable to attach to browser" when trying to debug, Ubuntu, Chrome #178858

Closed
mofojed opened this issue Apr 1, 2023 · 3 comments
Closed

"Unable to attach to browser" when trying to debug, Ubuntu, Chrome #178858

mofojed opened this issue Apr 1, 2023 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@mofojed
Copy link

mofojed commented Apr 1, 2023

Type: Bug

Does this issue occur when all extensions are disabled?: Yes

When I try to launch Chromium using the "Run and Debug" option in VSCode, it fails after a couple seconds with an error saying "Unable to attach to browser".

I've tried opening the launch.json and adding the runtimeExecutable path to my Chromium install, and it still gives the same error.

I've tried uninstalling Chromium and reinstalling using sudo apt install chromium-browser, same error.

Chrome Version: 111.0.5563.146

My launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      // "runtimeExecutable": "/snap/bin/chromium",
      // "runtimeExecutable": "/usr/bin/chromium-browser",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:4000",
      "webRoot": "${workspaceFolder}"
    }
  ]
}

VS Code version: Code 1.77.0 (7f329fe, 2023-03-29T10:05:35.165Z)
OS version: Linux x64 5.15.0-1032-oracle snap
Modes:
Sandboxed: No

System Info
Item Value
CPUs AMD Ryzen 9 3950X 16-Core Processor (32 x 2200)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
Load (avg) 1, 1, 1
Memory (System) 62.75GB (41.85GB free)
Process Argv --no-sandbox --force-user-env --unity-launch --crash-reporter-id ddb2080e-9c23-4a55-b858-e42c8bf57998
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
Extensions (24)
Extension Author (truncated) Version
markdown-mermaid bie 1.18.0
vscode-eslint dba 2.4.0
gitlens eam 13.4.0
vscode-npm-script eg2 0.3.29
prettier-vscode esb 9.10.4
copilot Git 1.78.9758
vscode-pull-request-github Git 0.62.0
terraform has 2.25.4
vscode-peacock joh 4.2.2
rainbow-csv mec 3.6.0
vscode-scss mrm 0.10.0
playwright ms- 1.0.9
isort ms- 2022.8.0
python ms- 2023.6.0
vscode-pylance ms- 2023.3.40
jupyter ms- 2023.3.1000892223
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
vsliveshare ms- 1.0.5834
react-proptypes-intellisense OfH 1.0.3
vscode-stylelint sty 1.2.4
markdown-all-in-one yzh 3.5.1
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30610679
nodejswelcome1:30587005
3biah626:30602489
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
showlangstatbar:30672706
pythonb192cf:30669361
azdwalk:30687957
pythonms35:30701012

@mofojed
Copy link
Author

mofojed commented Apr 1, 2023

I've dug into the developer logs, and I see this when I try to launch:

==> sharedprocess.log <==
2023-03-31 20:06:40.144 [error] [uncaught exception in sharedProcess]: Cannot read properties of undefined (reading 'then'): TypeError: Cannot read properties of undefined (reading 'then')
    at h.s (/snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:23:5588)
    at h.q (/snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:23:4988)
    at /snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:23:4377
    at E.invoke (/snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:19:145)
    at u.deliver (/snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:19:2121)
    at l.fire (/snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:19:1729)
    at MessagePortMain.B (/snap/code/123/usr/share/code/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js:17:23772)
    at MessagePortMain.emit (node:events:526:28)
    at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:5:364)

@connor4312
Copy link
Member

Duplicates microsoft/vscode-js-debug#1628 (comment)

@connor4312 connor4312 added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 1, 2023
@mofojed
Copy link
Author

mofojed commented May 11, 2023

I was still having problems in v1.77.3, turns out I had VSCode installed through snap. I tried installing with the .deb package and that seems to have fixed the issue: https://code.visualstudio.com/docs/setup/linux

@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants