Typescript VS2017 stops at first line, error: Debu

2019-08-19 04:19发布

When I start a newly created Typescript Project in Visual Studio 2017 theres some strange behaviour going on.

-The debugger breaks on the very first line

-The output shows:

code:-32000
message:Debugger agent is not enabled

-Many scripts in solution explorer (see screenshot)

-Node output:

Debugger listening on wb://127.0.0.1:5858/03dde2a0-7ae8-44fc-8b29-53b99c072de7
For help see https://nodejs.org/en/docs/inspector
Debugger attached.

Screenshot: vs screenshot

Edit:

Seems to be a problem with the new node version. If I switch back to 5.4.1.0 (included in VS2017) everything works fine. I read that there has been a change in debugger protocol maybe it has something to do with that... gotta wait for an update.

2条回答
Explosion°爆炸
2楼-- · 2019-08-19 04:21

To show the Console, we can use: Debug -> Windows -> JavaScript Console.

Michael Braude showed two suggestions for the similar 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.

For detailed information:

Visual Studio Tools for Apache Cordova stops work correct after update

查看更多
老娘就宠你
3楼-- · 2019-08-19 04:41

I got it working again by using the included node version of VS2017. There seems to be a problem with the new version <8.

You can choose which version to use by putting the path to the exe folder on top of the list here: Tools > Options > Projects and Solutions > Web Package Management > External Web Tools

查看更多
登录 后发表回答