[0.8.1] How to enable debug in VS2012 ?

Topics: General
Nov 28, 2012 at 1:31 PM

Seems the debugging don't work out of the box in VS2012.

What shoud I fix to enable this feature ?

Coordinator
Nov 28, 2012 at 2:26 PM

To get going with debugging, you should only have to create an "HTML Application with TypeScript" after installing 0.8.1.  In Debug mode, this will pass the --sourcemap flag to the compiler and will allow you to debug the TypeScript directly after you hit F5 (and open in IE).

If you're trying it with your own project, you need to make the following changes:

  • Enable source map output in the compiler using the --sourcemap flag.  You can tell if you have done this successfully by looking at the .js file that is output.  If it has a "//@ sourceMappingURL=<filename>.js.map" style line at the bottom, it's set correctly.
  • Include the .ts and .js files that you're using to debug in your project
  • Debug your application with Internet Explorer (other browsers will not work)

With that, you should be good to go.  We're also putting out a point release soon that addresses a few issues that people with a few alternate configurations have hit, which may also help.

 

 


Coordinator
Nov 28, 2012 at 2:28 PM

Also, if you use Web Essentials, be sure to grab a version that is compatible with TypeScript 0.8.1. 

Nov 28, 2012 at 4:07 PM
Edited Nov 28, 2012 at 5:16 PM

Hi Jon - Do you know when the point release will be available? (Maybe a nightly build someplace?)

I'm hoping this issue can be resolved: http://typescript.codeplex.com/workitem/476

Now that I have .ts debugging working, I'd like to refresh the page and still hit breakpoints.

The workflow would be awesome then! Great Progress TypeScript team!

Jon

Nov 30, 2012 at 6:47 PM
Edited Nov 30, 2012 at 7:08 PM

@jonturner Pretty please on bug: http://typescript.codeplex.com/workitem/476 :)

My workflow w/ debugging w/ source maps is pretty bad right now have to restart a debugging session every time I want to refresh a page.

I'm probably just going to disable source maps for now.  Typescript is sooo close to making me more productive, but this one is really taking away!

Thanks much,

Jon

EDIT: I disabled source maps and now have the benefits of the DEV time productivity in .ts and can debug in VS's great js debugger.  I feel very strongly that we should always be able to drop down into the .js and debug readable code even when source maps mature.  I know there are other topics on this...floating around. Put me in the camp of idiomatic .js compilation so we always retain the ability to debug readable .js!  I respect others opinions on this, but there's no reason that we can't have both powerful .ts AND readable .js output.