vscode: Typescript breakpoints no longer work since 1.25

  • VSCode Version: 1.25 & 1.26 Insiders. 1.24.1 is working properly.
  • OS Version: Fedora 28 & Mac OS High Sierra (same symptoms)

Steps to Reproduce:

  1. Start our Node.js server app via launch.json or attach to a process started from the terminal.
  2. Try to set a breakpoint in the server .ts files.

Does this issue occur when all extensions are disabled?: Yes, it’s occurring with a vanilla Insiders Edition, too.

Our Typescript directory structure is the following:

  • src/... - Typescript source files
  • build/... - Built Javascript files
  • build/src/... - Source maps

E.g. src/app.ts is the main source file, build/app.js is the Javascript, build/src/app.js.map is the source map. The Javascript files point to the source maps at their end with a relative path e.g.

//# sourceMappingURL=../src/server/app.js.map`.

The source maps are built with gulp and they point to the exact absolute source path at their end e.g.

"sourceRoot": "/home/gombosg/myApp/src"`

outFiles is properly set in launch.json, but simply attaching to a running process worked, too.

This used to work perfectly, breakpoints always worked, but they appear as ‘unverified’ (greyed and hollow) since 1.25. Downgrading back to 1.24.1 helped though.

Let me know if you need some special logs.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 25 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Please try this workaround for mac/linux. Add this to your launch config:

"pathMapping": {
    "/": "/"
}

You will get an warning that the property is “not allowed”, ignore it.

This will be fixed in TS’ end in TS 3.0, but I’m trying to get a workaround out on our end in Insiders.

It appears that if I remove mapRoot from my tsconfig.json the breakpoints are properly handled and I can now debug again! 😃

Here are my configs in case others experience issues to aid in possible troubleshooting.

Before

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "es7",
      "dom"
    ],
    "mapRoot": "../dist/server",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "../dist/server",
    "sourceMap": true,
    "strictNullChecks": false,
    "noUnusedLocals": false,
    "target": "es6",
    "typeRoots": [
      "../node_modules/@types",
      "./types"
    ]
  }
}

After

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "es7",
      "dom"
    ],
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "../dist/server",
    "sourceMap": true,
    "strictNullChecks": false,
    "noUnusedLocals": false,
    "target": "es6",
    "typeRoots": [
      "../node_modules/@types",
      "./types"
    ]
  }
}