vscode-js-debug: [BUG] primordial.js is not skipped by skipFiles on launch.json or settings.json

🐛 What is the bug? How can we reproduce it?

Just before the end of the debugging session, appears a new tab with primordials.js, it is a file located on \<node_internals>\internal\per_context\primordials.js, inside the file, it places on the function uncurryThis. I have used "<node_internals>/**" and "<node_internals>/**/*.js" and doesn’t work. It is just a simple debugging on an index.js no fancy framework. I tried also disabling all the extensions, keep not working.

image image image image image image

Please put here any steps, code or any information that can help us reproduce the error on our side so we can fix it:

  1. Step 1 An index.js file with the next code of the screenshot

  2. Step 2 2.1 Use the auto attach - smart, run node index.js. 2.2 Use a launch.json like in the screenshot and run the debugger with that config. Both ends with the same uncurryThis function on primordials.js

  3. Repeat changing the paths, restarting extension host, or killing vs code process and then open again. Nothing works.

Expected behavior

Don’t open primordials.js when debug.

Debug output

Debug Console

baz
index.js:2
bar
index.js:7
foo
index.js:12

Developer Tools console

After clear console, and run the debugger, the console prints:

workbench.desktop.main.js:62 [Extension Host] [WakaTime][DEBUG] Sending heartbeat: c:\Users\usuario\.vscode\extensions\wakatime.vscode-wakatime-5.0.1\wakatime-cli\wakatime-cli.exe --file <node_internals>\internal\per_context\primordials.js --plugin "\"vscode/1.55.2 vscode-wakatime/5.0.1\"" --config C:\Users\usuario\.wakatime.cfg --log-file C:\Users\usuario\.wakatime.log
workbench.desktop.main.js:62 [Extension Host] [WakaTime][DEBUG] last heartbeat sent Apr 26, 2021 12:28 AM

Something about the extension WakaTime, I disabled it, restart, and re run debugger, and the problem keeps appearing.

Environment

Please tell us about your system and your project: System: Windows 10 Home Version 21H1 OS build 19043.962 Experience Windows Feature Experience Pack 120.2212.3530.0

Visual Studio Code: Version: 1.55.2 (user setup) Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d Date: 2021-04-13T09:35:57.887Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19043

Node.js version installed: 14.15.5

Project: index.js file with some functions and console.logs.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (9 by maintainers)

Most upvoted comments

Fyi I’ve implemented “synthetic black boxing” in https://github.com/microsoft/vscode-js-debug/issues/1085 to get around the Node bugs

You’re pressing Step Out at the end of the file. When this happens, the debugger will try to step out to whoever called the function you’re in, which is internal Node code when you’re at the top level of a module. There’s an existing bug in Node with blackbox patterns not working around async code, which is what you’re hitting here.

To get around this, you should press Continue (keybinding: F5) instead of Step Out – it doesn’t seem like you actually want to step out in this case.

Yes, with that setting on the difference is night and day! Thanks so much for your help!

It no longer drops into node primordial.js and restricts itself to my source files with adequate source-mapping as far as I can see.

I think the remaining wierdness is real. For example the Javascript when calling a class constructor often looks as if it’s executing elements of class definitions out-of-order when following Typescript source maps, but I think execution probably actually IS jumping over the place out of order because it’s transpiled from Typescript, so it’s a miracle it works at all. It’s much much more usable now!