Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can no longer debug typescript files in Visual Studio 2013 Update 3 #556

Closed
zenoware opened this issue Aug 28, 2014 · 28 comments
Closed

Can no longer debug typescript files in Visual Studio 2013 Update 3 #556

zenoware opened this issue Aug 28, 2014 · 28 comments
Assignees
Labels
Bug A bug in TypeScript Needs More Info The issue still hasn't been fully clarified Visual Studio Integration with Visual Studio

Comments

@zenoware
Copy link

Not even sure how this has happened, but I was able to use Visual Studio and debug with Internet Explorer 11 for the longest time without any issues. Then, one day the breakpoints started not to load. After emptying the cache in Internet Explorer, they loaded again. Now, they are consistently not loading. The Script Document shows the javascript files that are compiled and I can debug in Firefox (even the typescript files) so I assume the map files are correct. I have reinstalled Visual Studio and IIS just to eliminate any of those being an issue, so I am now turning here and hopefully this is just some simple issue.

I have gone through at least 20 possible solutions for this issue and the fact that I can hit a breakpoints in the Script Documents tells me something is up.

@basarat
Copy link
Contributor

basarat commented Aug 28, 2014

Can you debug a simple pure JavaScript files from VS2013?

@zenoware
Copy link
Author

Yes, I can hit breakpoints that are javascript files even in that same project (IE. Knockout.js). It is only the typescript files I seem to not be able to trigger a break point claiming the symbols have not been loaded.

@basarat
Copy link
Contributor

basarat commented Aug 28, 2014

@zenoware what does this button say for you in IE11 debug tools:

image

@zenoware
Copy link
Author

It does say the same thing as what you are displaying:
debugging

@RyanCavanaugh
Copy link
Member

If you can debug the source maps correctly in FireFox but not in IE, you'll probably have to take this to the IE F12 tools team. I'll point them in this direction and see if they can follow up for more details.

@paulvanbrenk
Copy link
Contributor

@zenoware

Just to clarify you are not able to hit breakpoints in either VS or IE, but this works as expected in Firefox?

Are you able to hit breakpoints in Chrome? Which version of VS are you using, are any updates installed? Which version of IE are you using (can you paste the complete version number from the about box)?

Can you post the full last line from the generated js file you're having trouble with? The one which shows where to find the sourcemap.

@zenoware
Copy link
Author

@paulvanbrenk to answer your questions:

this works as expected in Firefox?

  • Yes, I can debug the ts files from Firefox
    Are you able to hit breakpoints in Chrome?
  • Yes, just tested it and I can hit breakpoints in ts files.
    Which version of VS are you using, are any updates installed?
    vs

Which version of IE are you using (can you paste the complete version number from the about box)?
ie
Can you post the full last line from the generated js file you're having trouble with?
First off, it is every single ts file i have. Even on different projects. Here is one example:
//# sourceMappingURL=Forest.js.map

@zenoware
Copy link
Author

@RyanCavanaugh Thanks for showing them this as well. If I cannot resolve this, I will attempt a few more things before reverting to re-installing windows (very last effort)

@ahbn
Copy link

ahbn commented Aug 29, 2014

I met the same problem. Update2 do not have this problem, you can uninstall the Update3.
In the installation Update2。

@zenoware
Copy link
Author

@ahbn That is a shame because isn't TypeScript 1.0 on Update 3? If it works, that is what I will do.

@zenoware
Copy link
Author

@ahbn Reverting back to Update 2 did fix my problem! Thanks for the information. I am curious why this is an issue with Update 3? So there is a work around but still an issue that needs to be investigated. But is it an IE issue or a Visual Studio issue is something I am not sure about.

@ahbn
Copy link

ahbn commented Aug 29, 2014

I try to reinstall the system, directly install Update3 cannot breakpoint problems arose, and then I switched back to Update2, is normal, then I install Update3 again on this basis, the problem appeared again, so I feel that the problem may be Update3. Currently I use normal under the Update2.

@sheetalkamat
Copy link
Member

@zenoware, can you please provide simple repro project for us to investigate? I would like to see your project settings, js file, map file contents and paths for sources etc.
Do you see any message in output window of VS? VS normally shows the error why the source map cannot be read.

@Lenne231
Copy link

I have the same issue with Visual Studio 2013 Update 3, everything is fine with Update 2.

@johnnyreilly
Copy link

For what it's worth I'm debugging TS with update 3 without issue in IE 11. I'm on Windows 8.1 (not sure if that's relevant)

@Sleepyowl
Copy link

Same here. I cannot debug Typescript it in Visual Studio 12.0.30723.00 Update 3 while being perfectly able to debug regular javascript. Source maps are working in IE11 though so I can debug ts in IE11. All my teammates with Update 3 cannot debug ts in VS and the only guy who didn't bother with Update 3 can. Project runs on Local IIS.

@johnnyreilly
Copy link

It's just occurred to me that I run my Visual Studio as an administrator (you can shift and right click to see "Run as administrator" on a context menu). It could be worth trying that to see if it makes a difference?

@Sleepyowl
Copy link

I always run it with elevated rights so no, no effect.

@AbubakerB
Copy link
Contributor

i have the same issue, only that im using --out and compiling multiple ts files into one js file and also creating the .map file.
On chrome, it maps it correctly, however, on VS2013.3, when i put a breakpoint on the .ts file, it's hit, but it focuses on the wrong file.... it always focuses on the .js file.
And not on the right line on the .js file, but rather on the line it should be on the .ts, but on the.js file.
e.g: if i place breakpoint on line:15 on a.ts, when hit, it focuses on compiled.js line:15, although the relevant js code for a.ts could start on line:890 on compiled.js.

So 1) it focuses on wrong file and 2) focuses on wrong line in wrong file.

I have my VS2013.3 running as administrator. Again, it works fine on chrome, but not on VS.

@typescripter
Copy link

Hi, not sure if this will help but I had same issue before I realized I had

BundleTable.EnableOptimizations = true;
in BundleConfig.cs

Settings this to false allowed me to debug in .ts files again. This is set to true by default.

Not sure what type of project template you are using. Hope this helps someone.

@Sleepyowl
Copy link

We're using requirejs to get the files. Also debug works on a single machine with VS2013U3. We're yet to figure out, why.

@Sleepyowl
Copy link

Update 4 resolved the issue. Yay.

@miaodadao
Copy link

VS2013.4 also can NOT debug TypeScript also.
My VS version is 12.0.31101.00 Update4
My IE version is 11.0.9600.17416, Update Version is 11.0.14(KB3003057)

@RyanCavanaugh RyanCavanaugh added the Visual Studio Integration with Visual Studio label Nov 26, 2014
@mleyb
Copy link

mleyb commented Feb 13, 2015

I also get this problem and have done since update 3

I can debug .ts files in Firefox, but not in Chrome or IE

EDIT: Scratch this - for some reason Chrome had disabled source maps on me. IE works OK too.

@mhegazy mhegazy added Bug A bug in TypeScript and removed External Relates to another program, environment, or user action which we cannot control. labels Feb 20, 2015
@mhegazy mhegazy added this to the TypeScript 1.5 milestone Feb 24, 2015
@mantalope
Copy link

I was using Web Essentials to minify the JS files and experiencing the same problem in Update 4. When I changed my HTML reference to the un-minified JS files, breakpoints began to work again...at least so far.

@frodegil
Copy link

Had the same issue. Mantalope gave me an idea. I had just recently changed the script reference in my index.html file to the minified version of the JavaScript file (typescript output). Changing from "myfile.min.js" to "myfile.js" fixed the problem. Typescript debugging in VS works again.

@sheetalkamat
Copy link
Member

I installed update 4 and created typescript app and wasn't able to repro this issue. Played around a code bit by adding internal modules, classes, functions etc and still was able to debug properly. If anyone who is still running into this with update 4, if you can share your project/code, I would be able to investigate in detail.

I also installed web essentials later, there is no option to minimize the typescript file output. The minimized .js file has missing sourceRoot entry and hence vs doesn't allow you to debug that file. I added that entry manually and the offsets seem to be off. But that's again done with web essentials minimizer and not the typescript compiler. Note that VS doesn't support indirect/linked sourcemaps right now.

@mhegazy
Copy link
Contributor

mhegazy commented May 25, 2015

I believe the main issue reported in this issue has been addressed. closing. please file a new issue if you are still experiencing problems with debugging.

@mhegazy mhegazy closed this as completed May 25, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Needs More Info The issue still hasn't been fully clarified Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests