Search code examples
javascripttypescriptvisual-studio-codebreakpoints

VS Code Logpoint suspends/breaks the execution unexpectedly


I am quite new to JavaScript/TypeScript development in VS Code. I wanted to start experimenting with Eclipse Theia, and so I have implemented a backend service. I wanted to put a logpoint in my backend service to see on the console when it is called.

Logpoint in VS Code

But sadly, when the execution reaches the respective line, execution is suspended. Only after resuming execution, the expected log message is printed.

This is my setup:

I have created https://github.com/xpomul/theia-boilerplate and there, a branch named hello-world.

I use VS Code 1.63.2 and the Remote Containers Extension.

Here’s what I do:

  • Start VS Code
  • Use "Remote-Containers: Clone Repository in Container Volume...“ and clone the https://github.com/xpomul/theia-boilerplate repository branch hello-world
  • After some waiting to get everything installed, open hello-world-impl.ts and add a logpoint with the expression test in line 7 (so it has a diamond symbol)
  • Do to the Run/Debug view and select the Launch Backend launch configuration and start it
  • Open a browser at http://127.0.0.1:3000 and run Edit > Say Hello

I’d expect that the backend continues running and just prints test to the log.

Instead, it breaks/suspends execution at the line of the logpoint and I need to explicitly resume.

What am I doing wrong? Is it some configuration issue? Or is the logpoint functionality dependent on the node version (Theia uses Node 12...) and is just not yet supported? Or is it because of TypeScript or the usage of inversify?

EDIT: I have also captured and attached a debug trace file, if that helps: https://dav.winklerweb.net/s/y5snhRgfiyaEF2B


Solution

  • Turns out it was a bug in vscode-js-debug:

    https://github.com/microsoft/vscode-js-debug/issues/1191

    It’s fixed in the latest nightly build and should be available in the next official VS Code release.