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

Breakpoints are not hit when debugging #1265

Closed
BalassaMarton opened this issue Sep 10, 2016 · 6 comments
Closed

Breakpoints are not hit when debugging #1265

BalassaMarton opened this issue Sep 10, 2016 · 6 comments

Comments

@BalassaMarton
Copy link

BalassaMarton commented Sep 10, 2016

Similar to an old issue (#112 and #268), but with the latest tools. Breakpoints are not hit, neither in .ts, nor in generated or manually written .js files.

  • NTVS Version: 1.2.4072600
  • Visual Studio Version: 14.0.25425.01 Update 3
  • Node.js Version: 6.5.0
Expected behavior

Debugger should stop at breakpoints.

Actual behavior

Debugger doesn't stop at breakpoints.

Steps to Reproduce
  1. Create new Blank Node.js Console Application
  2. Place a breakpoint at the console.log() row in app.ts
  3. Build and start debugging
Additional notes
  • It doesn't matter if I set the breakpoint in the .ts or .js file, the debugger never stops.
  • If I start debugging with F10 (Step over), the debugger stops at the first line as expected, and I can even step into it.
  • Placing a debug; line in app.js and running node debug app.js also works as expected.
@mjbvz
Copy link
Contributor

mjbvz commented Sep 12, 2016

Thanks for the report.

I'm unable to repo this in my testing. Can you please also let me know the following to help with the investigation:

  1. In the first case, how are you launching the debugger? F5? Build -> Start Debugging in the menus?
  2. The version of TypeScript you are using in VS. This is under Help -> About Visual Studio.
  3. Do you have a tsconfig.json or configure the TypeScript build system?

Thanks.

@BalassaMarton
Copy link
Author

  1. F5 or click the green play button. Building the solution before starting makes no difference.
  2. TypeScript 1.8.36.0
  3. No tsconfig.json, I just use Project / Properties for setting up the TS configuration.

Workarounds I have tried without success:

  • Disable firewall (both Windows Firewall and ESET Smart Security)
  • Target ES6 or ES5
  • Run Visual Studio as administrator

I've also tried placing a debugger; line into my code. When run, Visual Studio instantly crashed without a meaningful error. However, when I execute node debug app.js in a command line, node's console debugger stops at the debugger; line as expected. Is there any way to test if Visual Studio has actually connected and receiving messages from the node debugger?

@mjbvz
Copy link
Contributor

mjbvz commented Sep 13, 2016

Here's a few more things to help with the investigation:

Go to Tools -> Node.js Tools -> Diagnostic Info... and check Enable Node.js Tools Live Diagnostics output pane. This will print information about NTVS's communication with the node debugger to the Output window in VS. Then please repo the debugger problem and paste the output from the window here.

For the VS crash, try looking in %appdata%\Roaming\Microsoft\VisualStudio\14.0\App\ActivityLog.xml This file may have information about the crash. If you could upload that as well, I can take a quick look through to see if anything stands out.

Thanks.

@BalassaMarton
Copy link
Author

Live Diagnostics output:
NTVSDebug.txt

@mjbvz
Copy link
Contributor

mjbvz commented Sep 14, 2016

Thanks. From these lines:

[13:07:31.7457061] AD7Engine Event: Microsoft.NodejsTools.Debugger.DebugEngine.AD7ModuleLoadEvent (989DB083-0D7C-40D1-A9D9-921BF611A4B2)
[13:07:31.8233563] AD7Engine Finalized (18659779)
[13:07:35.5497164] AD7Engine Called DestroyProgram
[13:07:35.5437158] DebuggerConnection: Connection was closed.
[13:07:35.5668503] AD7Engine Event: Microsoft.NodejsTools.Debugger.DebugEngine.AD7ThreadDestroyEvent (2C3B7532-A36F-4A6E-9072-49BE649B8541)
[13:07:35.5688589] AD7Engine Event: Microsoft.NodejsTools.Debugger.DebugEngine.AD7ProgramDestroyEvent (E147E9E3-6440-4073-A7B7-A65592C714B5)
[13:07:35.5713586] AD7Engine Called ContinueFromSynchronousEvent

This looks like another manifestation of #823 where the program is being finalized too soon during debugging. It's not clear right now if Node 6.5 introduced this regression or what exactly is causing it. It also does not repo on my machine, so it seems non deterministic. I'll investigate.

Longer term, we plan to move share more of our debugger components with VS code. This may help resolve some of the flakiness we've seen here.

@paulvanbrenk
Copy link
Contributor

Moved to shared debugger for Node 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants