Telling Chrome to debug js rather than ts

Alon picture Alon · Jul 6, 2016 · Viewed 8k times · Source

By default (and hopefully it's not the only option) when I have a ts file, Chrome only lets me debug the ts code. I.e it does show me the content of both the ts and js files, but when I try to put a break-point in the js file, it immediately transfers me to the ts file and locates the break-point in the right place.

How can I tell Chrome to debug the js file rather than the ts one?

Answer

Noah Freitas picture Noah Freitas · Jul 7, 2016

Since you don't have control over the TS compilation settings, you can disable JavaScript source maps all together in Chrome.

Load the developer tools (Chrome Menu > More Tools > Developer Tools), then load the developer tool settings (Developer Tools Menu > Settings), find the setting for "Enable JavaScript source maps" and disable it.