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

Remote Debugger does not do remoteRoot=>localRoot source mappings #1240

Open
pmunin opened this issue Jan 8, 2025 · 1 comment
Open

Remote Debugger does not do remoteRoot=>localRoot source mappings #1240

pmunin opened this issue Jan 8, 2025 · 1 comment

Comments

@pmunin
Copy link

pmunin commented Jan 8, 2025

Describe the bug

Debugging by attaching to remote host does not do remotePath=>localPath transformations. inspector-brk|wait still reveals remote paths

To Reproduce

docker-compose.yml:

services:
  worker-pool:
    image: denoland/deno:2.1.4
    volumes:
      - .:/app
    working_dir: /app
    command: [
    "run"
    ,"--inspect-brk=0.0.0.0:9229"
    ,"--allow-all"
    ,"src/index.ts"    
    ]

.vscode/launch.json/configurations:

{
      "name": "Workerpool: Attach to Docker",
      "type": "node",
      "request": "attach",
      "address": "worker-pool",
      "port": 9229,
      "remoteRoot": "/app",
      "localRoot": "${workspaceFolder}",
      "trace": true,
      "sourceMapPathOverrides": {
        "/app/*/*": "${workspaceFolder}/*",
      },
      "skipFiles": [
        "<node_internals>/**",
        "**/node_modules/**",
        "**/.deno/**",
        "/app/node_modules/**",
        "core/**"
      ]
    }

deno.json:

{
  "imports": {
    "express": "npm:[email protected]"
  },
  "nodeModulesDir":"auto"
}

Start docker compose

Launch debug configuration

It stops on preset breakpoint of some virtual files with remote paths, not existing locally. Files it steps on based on original files but may contain some transformations (e.g. source map comments)

Expected behavior

Break point should trigger at my local file, exactly where I put it. All paths in debugger should be replaced by remoteRoot=>localRoot rule according to launch.json configuration

Screenshots

Setting breakpoint before debugging:

image

Breakpoint triggered:

image

remote paths in Loaded Scripts, it also ignores the skipFiles of debug configuration:

image

Versions

vscode: 1.96.2 deno: 2.1.4 extension: 3.43.2

@pmunin pmunin changed the title Remote Debugger does not do remoteRoot=>localRoot mappings Remote Debugger does not do remoteRoot=>localRoot source mappings Jan 8, 2025
@tinder-tannerbennett
Copy link

tinder-tannerbennett commented Feb 15, 2025

I think I'm running into this as well. I'm trying to use Deno as a language server for a VS Code extension. My VS Code extension launches the server and connects to it (with --inspect-brk), and I attach to the server from the server project, and the output I get is clearly Javascript and not Typescript (even though the filename ends in .ts) and the sourcemap is at the bottom.

VS Code 1.97.0
Deno extension 3.43.3
deno 2.1.9 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants