admin管理员组

文章数量:1401604

I'm developing a small Angular app and I'm trying to debug it in Chrome DevTools. However, I can only see .ts files there.

How can I see and debug the .js files that .ts files pile to?

My 'Enable JavaScript source map' option in DevTools settings is turned on.

I'm developing a small Angular app and I'm trying to debug it in Chrome DevTools. However, I can only see .ts files there.

How can I see and debug the .js files that .ts files pile to?

My 'Enable JavaScript source map' option in DevTools settings is turned on.

Share Improve this question edited Dec 28, 2019 at 13:22 Sofia Bo asked Dec 28, 2019 at 11:10 Sofia BoSofia Bo 7791 gold badge10 silver badges20 bronze badges 8
  • 2 Any particular reason for this need? – Hugo Noro Commented Dec 28, 2019 at 11:19
  • you can check this link stackoverflow./a/50290220/5146848 – Sifat Haque Commented Dec 28, 2019 at 11:19
  • 1 Does this answer your question? Chrome sources not showing a file that was generated from Typescript and has a source map – Reactgular Commented Dec 28, 2019 at 11:46
  • did u build source code in JIT mode? This mode will not encoded your code and allow u to debug by browser. – Hoang Subin Commented Dec 28, 2019 at 13:26
  • Any particular reason? Well, wanted to debug the .js code + to see what .ts piles to. And no, unfortunately, links above did not help. I updated my answer with te information from them. – Sofia Bo Commented Dec 28, 2019 at 13:26
 |  Show 3 more ments

1 Answer 1

Reset to default 9

You need to disable Javascript Sourcemap:

Not in the question but if you need it for the SCSS/CSS files, there is also a CSS source map option there.

Another obscure way to disable it is if somehow do not want to change Chrome's settings and you have control of your server, you can configure it not to generate the source map line, it depends on your server-side generator/piler. You need to check the documentation to see how it works. The source map line should be at the end of the generated js file and look like this:

//# sourceMappingURL=/path/to/file.js.map

本文标签: javascriptChrome DevTools do not show js filesStack Overflow