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

Can't debug builtin extensions #105859

Closed
roblourens opened this issue Sep 1, 2020 · 5 comments
Closed

Can't debug builtin extensions #105859

roblourens opened this issue Sep 1, 2020 · 5 comments
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders

Comments

@roblourens
Copy link
Member

  • Start the "Renderer and Extension Host" launch config in vscode
  • Set a breakpoint in a .ts file in a builtin extension under ./extensions
  • It doesn't bind, but I can set breakpoints in the .js files
@roblourens
Copy link
Member Author

So it doesn't load the sourcemaps at all unless they are in outfiles? I thought that is only used for pre-loading.

@connor4312
Copy link
Member

We should load at runtime as well. I'll look at that.

@connor4312
Copy link
Member

Oh, yea. By default, now for Node we set resolveSourceMapLocations to the outFiles (if it's unset). So because we specified outfiles to use out/**/*.js, js-debug saw the sourcemap for the extension was outside of there and didn't resolve it.

I think this is good behavior, actually. It makes things more deterministic -- if you set a breakpoint, in a file, we know that it will get bound and hit consistently, or it won't. Previously, poor configurations were 'hidden' by the runtime loading -- we'd hit the BP if we were able to load sourcemaps fast enough, but we might miss it sometimes.

@roblourens
Copy link
Member Author

I think that does make sense. If I don't set outFiles, we do the best we can. If I set outFiles and it's wrong, we don't bind breakpoints in files that are missed by outFiles. I like things being deterministic.

@kennyyyb
Copy link

I was also having this issue when I upgraded to 1.49.0.

My use case was debugging mocha tests.

The fix for me was to add "outFiles": ["${workspaceFolder}/dist/**/*.js"] to my lauch.json configuration. N.B., my tsconfig.json has "outDir": "dist".

{
  // 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": [
    {
      "args": ["--timeout", "999999", "--colors", "${workspaceFolder}/test"],
      "internalConsoleOptions": "openOnSessionStart",
      "name": "Mocha Tests",
      "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
      "request": "launch",
      "skipFiles": ["<node_internals>/**"],
      "type": "pwa-node",
      "outFiles": ["${workspaceFolder}/dist/**/*.js"]
    }
  ]
}

As a side note, when I use "Add Configuration" --> "Node.js: Mocha Tests" the config added to launch.json includes: "args": [ "-u", "tdd", "--timeout", "999999", "--colors", "${workspaceFolder}/test" ],

I have to remove the "-u" and the "tdd" for the debug to work.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

No branches or pull requests

4 participants
@roblourens @connor4312 @kennyyyb and others