Sourcemap refers to an invalid line, most often the last line of the source file

I am using grunt-ts (v5.3.0beta.2, tsc v1.7.3) to compile my typscript files into javascript using inlineSource + inlineSourceMaps for debugging

My grunt configuration is as follows:

grunt.initConfig({
  ts: {
    project: {
      src: ["app/client/**/*.ts"],
      options: {
        removeComments: false,
        failOnTypeErrors: true,
        inlineSourceMap: true,
        inlineSources: true
      },
      outDir: "tmp/built/app"
    }
  }
});

Now chrome picks up the source cards, but the line number is always wrong, most of the time it is only the last line in the code.

In this example, its reference line is number 51, but it should be line number 21: enter image description here

+4
source share

Source: https://habr.com/ru/post/1619763/


All Articles