vscode-js-debug: Turbo sourcemaps not hitting TS breakpoints in imported modules

I believe this issue is in relation to the new debugger optimizations in patch 1.75 last week

When the patch hit last week we were unable to put breakpoints into ‘*.ts’ files in imported modules and have them hit. We’re running a lerna monorepo if that’s useful.

  • Breakpoints on the ‘*.ts’ files in the package we execute the code did work.
  • Breakpoints on the ‘*.js’ files in our /dist/ folders for both the original package and the imported ones did hit correctly.
  • Breakpoints on any ‘*.ts’ files from imported modules did not fire.
  • Adding "enableTurboSourcemaps": false to our launch.json file fixes the issue

I’m not sure what would be helpful to debug this but here is my profile from launch.json

    {
      "name": "🚀 GQL Lambda API: (RUN)",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "-r",
        "ts-node/register"
      ],
      "cwd": "${workspaceRoot}",
      "console": "integratedTerminal",
      "program": "${workspaceFolder}/src/servers.ts",
      "sourceMaps": true,
      "enableTurboSourcemaps": false, // this fixed the issue
      "envFile": "${workspaceFolder}/../../.env.local.${input:environment}",
      "outFiles": [
        "${workspaceFolder}/../dist/**/*.js",
        "!**/node_modules/**"
      ],
    },

This worked flawlessly until VSCode updated last week. The note in the changelog said enableTurboSourcemaps will eventually be depprecated so obviously we’d like to see some kind of resolution to the issue before that happens.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 20 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Will send it again from my private mail account … give me a minute …

You probably have a different issue then. Please collect a trace log using the instructions I shared above and I can look into it.

Thanks for the log, that actually is an issue that regressed last month 😄

@segevfiner thanks for the repro. The issue you’re hitting is specific to extension host debugging, and I’m not sure why it would have worked before. But that’ll be fixed in the next nightly build.

@MattReimer I’m not able to repro the issue with multiple glob stars in isolation.

For others, please provide either similar repros, or log files using the instructions given in the “bug” issue template:

If you’re able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.

⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you’d rather not share the log publicly, you can email it to connor@xbox.com

Here’s another interesting datapoint:

It seems like when there’s a double ** in my output files in launch.json it won’t work.

So this doesn’t work:

      "outFiles": [
        "${workspaceFolder}/../**/dist/**/*.js",
        "!**/node_modules/**"
      ],

But this DOES work.

      "outFiles": [
        "${workspaceFolder}/../lambda-api/dist/**/*.js",
        "!**/node_modules/**"
      ],

I wonder if **/something/** is forbidden or something

MWE/reproduction: https://github.com/segevfiner/vscode-js-debug-bug

Try breaking in app.ts (Code in the server)