Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telling Chrome to debug js rather than ts

Tags:

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?

like image 715
Alon Avatar asked Jul 06 '16 11:07

Alon


People also ask

How do I inspect a JavaScript variable in Chrome?

To view any variable in chrome, go to "Sources", and then "Watch" and add it. If you add the "window" variable here then you can expand it and explore.


1 Answers

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.

like image 127
Noah Freitas Avatar answered Nov 17 '22 11:11

Noah Freitas