Skip to content

Remote development(debug). Incorrect port gets forwarded to UI. Applicable for pwa-chrome and similar launch modes #1162

@zkx5xkt

Description

@zkx5xkt

Describe the bug
When using remote workspace with pwa-chrome launch mode incorrect dynamic port gets forwarded to UI (remote port instead of local port).
Thus js-debug-companion uses aforementioned port which results in broken debug.
Problem is only reproducible when ports (local/remote) are different.

It seems like this problem has been described before in #982. It has been closed but problem seems to persist.

To Reproduce
Steps to reproduce the behavior:

  1. on your local machine run following script (it occupies set port range hence local vscode is forced to use ports with which it runs into the problem).
const net = require("net");
function *range(from, to) {
    for (let i = from; i < to; i++) yield i;
}

function runServer(port) {
   const server = new net.Server();
   server.listen(port, "127.0.0.1");
   return server;
}

// adjust port range to your environment. (use ports you will see in vscode port forwarding view from step 2)
const servers = [...range(51000, 59999)].map((port) => runServer(port));

// servers.map((server) => server.close());
  1. in vscode command prompt run 'Debug: Open Link' and enter some link (for example: https://code.visualstudio.com/)
  2. observe debugger does not work

Log File

VS Code Version: 1.63.2

Additional context
applicable for remote development
my env:

  • remote on ubuntu 18.04 (hyper-v VM)
  • local on windows 10

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions