typescript调试/断点不起作用 [英] typescript debug / breakpoint does not work

查看:1168
本文介绍了typescript调试/断点不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天以来,调试器不再工作了。我已经尝试了几件事情没有成功。




  • typescript 0.9.1

  • VS2012

  • IE10

  • 源地图,当我保存TS文件时JS文件被更新



在Visual studio中断点的位置我已经得到:
'断点当前不会被打。没有加载此文件的符号'




  • 任何帮助?


  • IE如何加载符号?我认为它与源地图有关...




提前感谢



Richard

解决方案

这是答案(我的问题...在WiredPrairie的帮助下。 .. ;-))



此行

 <导入Project =$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targetsCondition ='$(BuildingInsideVisualStudio)'=='true'/> 

超过我的线条

 < PropertyGroup Condition ='$(Configuration)'=='Debug'> 
< TypeScriptTarget> ES5< / TypeScriptTarget>
< TypeScriptRemoveComments> true< / TypeScriptRemoveComments>
< TypeScriptSourceMap> true< / TypeScriptSourceMap>
< TypeScriptModuleKind> AMD< / TypeScriptModuleKind>
< / PropertyGroup>
< PropertyGroup Condition ='$(Configuration)'=='Release'>
< TypeScriptTarget> ES5< / TypeScriptTarget>
< TypeScriptRemoveComments> true< / TypeScriptRemoveComments>
< TypeScriptSourceMap> true< / TypeScriptSourceMap>
< TypeScriptModuleKind> AMD< / TypeScriptModuleKind>
< / PropertyGroup>

所以我把它放在AFTER(什么聪明的家伙,不是它的---))在我的* .csproj



我发现问题是因为:


  1. //#sourceMappingURL = / path / to / file.js.map 在* .js文件的末尾生成,而不是编译时。


  2. 构建输出是说 TypeScript编译器被赋予一个空配置字符串,这是非常可疑的。。 / p>


解决方案来自于这篇文章: TypeScript编译器被赋予一个空配置字符串



当我尝试将我的项目部署到Azure时,会出现问题。 js文件没有上传/编译,所以我在csproj的坏运气中添加了这个棘手的一行: - (



谢谢,我希望它会帮助别人。 / p>

Since few days, debugger does not work anymore. I've tried several things without success.

  • typescript 0.9.1
  • VS2012
  • IE10
  • the source map, JS files are updated when I save the TS files

In Visual studio at the place of the breakpoint I've got: 'The breakpoint will not currently be hit. No symbols have been loaded for this document'

  • Any help?

  • How IE load the symbols? I assume it's related to the source map ...

Thank in advance

Richard

解决方案

Here is the answer (of my question ... with the help of WiredPrairie, ... ;-) )

This line

<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" Condition="'$(BuildingInsideVisualStudio)' == 'true'" />

was preceeding my lines

 <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
  </PropertyGroup>

So I put it AFTER ( what a smart guys, isn't it ;-) ) in my *.csproj

I found the problem because:

  1. The //# sourceMappingURL=/path/to/file.js.map was generated at the end of the *.js files when saving, not when compiling.

  2. The build output was saying The TypeScript Compiler was given an empty configurations string, which is unusual and suspicious..

The solution comes from this post: TypeScript Compiler was given an empty configurations string.

The root cause of the problem appears when I tried to deploy my project to Azure. The js files were not uploaded/compiled, so i've added this tricky line in the csproj bad luck :-(

Thank and I hope it will help others.

这篇关于typescript调试/断点不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆