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 launch Chrome when working with a remote container #908

Closed
nsgundy opened this issue Jan 15, 2021 · 15 comments
Closed

Unable to launch Chrome when working with a remote container #908

nsgundy opened this issue Jan 15, 2021 · 15 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@nsgundy
Copy link

nsgundy commented Jan 15, 2021

Describe the bug
When trying to launch Chrome using pwa-chrome while attached to a remote container, the extension is unable to launch Chrome and I get to see this:
image

To Reproduce
Steps to reproduce the behavior:

  1. Launch a workspace in a remote container
  2. Launch the following default launch config:
    {
        "name": "Launch Chrome",
        "request": "launch",
        "type": "pwa-chrome",
        "url": "http://localhost:3000",
        "webRoot": "${workspaceFolder}"
    }

I have tried this as part of a .code-workspace as well as launch.json, neither work.

Log File
vscode-debugadapter-2ff4ba31.json.gz

VS Code Version: 1.52.1
JavaScript Debugger (Nightly) Version: v2021.1.817
JavaScript Debugger Companion Extension Version: v1.0.8
Remote -Containers Version: v0.154.2

Additional context
OS: Ubuntu 20.10
When opening the same workspace locally, launching Chrome works just fine. I have attempted to do this both with and without the nightly version.

The example given is quite bare on purpose. Normally I would have it execute a pre-launch task that spins up a webpack dev-server. The environment is supposed to be able to run on Linux, Windows and Mac and requires a specific version of nodejs, hence the use of a container.

@nsgundy nsgundy added the bug Issue identified by VS Code Team member as probable bug label Jan 15, 2021
@connor4312
Copy link
Member

Does it work if you manually specify the chrome path using the runtimeExecutable property?

@nsgundy
Copy link
Author

nsgundy commented Jan 15, 2021

Does it work if you manually specify the chrome path using the runtimeExecutable property?

I have tried by adding "runtimeExecutable": "/usr/bin/google-chrome" to the launch config. The only difference is that the Unable to attach to browser message appears right away (before it would take a couple of seconds).

Log File
vscode-debugadapter-619129f0.json.gz

@nsgundy
Copy link
Author

nsgundy commented Jan 27, 2021

@connor4312 Sorry to bug you, just wondering if there is anything else for me to try?

@nsgundy
Copy link
Author

nsgundy commented Feb 12, 2021

I have re-tested this with VS Code Version 1.53.2 and JavaScript Debugger 1.53.0. Its still a problem for me.

@nsgundy
Copy link
Author

nsgundy commented Feb 15, 2021

Hey, just tested this on Windows today and there the same thing works as expected(same Docker container, same versions of VS Code and extensions as above). So Ubuntu (or Linux) only it seems.

@tomatac
Copy link

tomatac commented Feb 23, 2021

I'am having the same issue in Ubuntu 20.04

@kalebpace
Copy link

kalebpace commented Feb 24, 2021

I've been having the same issue on Archlinux 5.10.16.

Granted this doesn't solve the issue with js-debug itself, but hopefully this will help anyone re-enable launch-to-debug until this is fixed.

My current work around:

  • Disable js-debug with: debug.javascript.usePreview: false
  • Reinstall the old Debugger for Chrome (msjsdiag.debugger-for-chrome) extension
  • In launch.json set "type": "chrome" to enable launching with the legacy extension above

My launch.json:

{
    "name": "Launch Chromium Debug (Legacy)",
    "request": "launch",
    "type": "chrome",
    "url": "http://localhost:8080/",
    "webRoot": "${workspaceFolder}",
    "runtimeExecutable": "/usr/bin/chromium"
}

@connor4312
Copy link
Member

connor4312 commented Mar 1, 2021

The fix will be available on Insiders tomorrow, and in stable early next month.

connor4312 added a commit to microsoft/vscode that referenced this issue Mar 1, 2021
@alexr00
Copy link
Member

alexr00 commented Mar 25, 2021

Verified on Ubuntu with

    {
        "name": "Launch Chrome",
        "request": "launch",
        "type": "pwa-chrome",
        "url": "http://localhost:3000",
        "webRoot": "${workspaceFolder}"
    }

@alexr00 alexr00 added the verified Verification succeeded label Mar 25, 2021
@tomatac
Copy link

tomatac commented Mar 28, 2021

It looks like this is fixed! Thanks!
One note. Having an incorrect setting to:
"webRoot": "${workspaceFolder}/app/src"
generates the same error.
It would be nice to tell that the path does not exist.

@tomatac
Copy link

tomatac commented Mar 30, 2021

It looks like this error is back for me. How can I troubleshoot this issue?
image

@davidshq
Copy link

I'm running into the same issue on Ubuntu 20.04.2 using:

  • VSC 1.56.2
  • Debugger for Chrome 4.12.12
  • Remote Containers 0.177.2

@connor4312
Copy link
Member

Where is your chrome executable located?

@davidshq
Copy link

/usr/bin/google-chrome

@JacobFV
Copy link

JacobFV commented Dec 24, 2021

I did something similar to @alexr00. Here is my launch configuration:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Next.js: debug server-side",
      "type": "node-terminal",
      "request": "launch",
      "command": "npm run dev",
      "sourceMaps": true,
    },
    {
      "type": "pwa-chrome",
      "runtimeExecutable": "/usr/bin/google-chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost:3000",
      "url": "http://localhost:3000",
      "sourceMaps": true,
    },
    {
      "name": "Next.js: debug full stack",
      "type": "node-terminal",
      "request": "launch",
      "command": "npm run dev",
      "console": "integratedTerminal",
      "runtimeExecutable": "/usr/bin/google-chrome",
      "sourceMaps": true,
      "serverReadyAction": {
        "pattern": "started server on *",
        "uriFormat": "http://localhost:3000",
        "action": "debugWithChrome"
      }
    }
  ]
}

This works for me on Ubuntu 20.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants