Visual Studio Tools for Apache Cordova stops work correct after update

谁说胖子不能爱 提交于 2019-12-24 16:17:44

问题


I am developing ionic application with Visual Studio Tools for Apache Cordova. Everything was OK until I updated Tools for Apache Cordova and TypeScript Tools for Visual Studio. After this update Ripple emulator became unstable and get the next error in the Output window.

code:-32000
message:Debugger agent is not enabled
The source map 'angular-sanitize.min.js.map' for file 'mdha:http://code.ionicframework.com/1.0.0-rc.5/js/ionic.bundle.min.js' could not be read from the specified location due to error 'Exception of type 'TypeScriptSourceMapReader.SourceMapReadFailedException' was thrown.'.

I am not using TypeScript in my project and I'm not familiar with it. What can I do for fix it? I guess I can remove my updates.

Could anybody suggest me any other better way?


回答1:


Thank Michael Braude, he helped me walk over this issue. As he explained, Visual Studio Tools for Apache Cordova uses same port for debugging after update v2.

There are two way to walk over this issue.

  1. Use JavaScript Console of Visual Studio. Frankly, this way is OK for me when I am developing on PC with two displays (I runs emulator on one screen and debug with Visual Studio on another), but a bit uncomfortable when I am developing on Notebook with one screen.
  2. Run a solution without debugging (CTRL+F5), in this case VS's debugger isn't attached to browser. This looks as simple solution, but you need to be aware that in this case breakpoints don't stop run-time and you have to use debugger; keyword.



回答2:


Unfortunately, this is a known issue with the current update of TypeScript + VS TACO. The Visual Studio product team intends to release a fix within the next few weeks. Until then, the best way to fix is to add the following setting to your tsconfig.json file:

"inlineSources": true

This will embed your typescript sources in the source map files so that you can debug them in all scenarios.

While you may be not using TypeScript, the latest versions of Ionic do use TypeScript and, thus, the error.



来源:https://stackoverflow.com/questions/32750376/visual-studio-tools-for-apache-cordova-stops-work-correct-after-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!