question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

🐛 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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
connor4312commented, Aug 20, 2021

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

2reactions
connor4312commented, Apr 26, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode launch.json's attribute 'skipFiles' not working as ...
I tried all the possible glob patterns but debugger didn't skip the specified paths. node and npm version. v14.16.0 and 6.14.11. code version( ......
Read more >
Debug Node.js Apps using Visual Studio Code
Setting up a project for Node.js debugging is straightforward with VS Code ... Debugging configurations are stored in a launch.json file located in...
Read more >
Nodejs debugging - vscode-docs1
js debugging has a feature to avoid code that you don't want to step through (AKA 'Just My Code'). This feature can be...
Read more >
How to debug Node.js apps in Visual Studio Code
Setting up a project for Node.js debugging is not particularly ... the create a launch.json file link in the RUN AND DEBUG: RUN...
Read more >
JSON Files - Business Central - Microsoft Learn
Description of the settings of the app and launch JSON files for AL in ... The rad.json and the snapshots.json files should not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found