-
Notifications
You must be signed in to change notification settings - Fork 281
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
[BUG] primordial.js is not skipped by skipFiles on launch.json or settings.json #980
Comments
You're pressing To get around this, you should press |
I'm noticing that this is happening even with "Step Into" (F11). This occurs when you Step Into ( Example Code1 class Math {
2 static async multiply(x, y) {
3 return x * y;
4 }
5 }
6
7 let result = await Math.multiply(x, y);
8
9 console.log(result); What's Going WrongIf you set a breakpoint on line 7 and Step Into ( Why Is This BadExpecting the user to place breakpoints before and after every This causes a giant amount of friction and wasted time, especially when new devs are trying to follow the execution path to learn new areas of code. This makes it very difficult to follow execution from end to end. Expected Behavior
IMO this issue should be reopened, please and thank you! |
@mrcates please share your log file by adding "trace": true to the launch.json. The location of the log file will be written to the debug console. However know that this is very likely a bug in Node.js or V8 rather than the debugger. |
well, interestingly enough this is fixed in the May release at least for Node 14 👍 Sounds like there's nothing more to see here! |
I'm also encountering the problem that every Step Into with 14.17.0 lands in primordials.js unfortunately and it is a huge obstacle to debugging typescript files in VSCode. The tests I am debugging pass, and they run correctly in typescript using the local jest config and interactively from VSCode, except for debugging. The configuration of my debugger is as follows, with parameters that previously worked to skip internal files I think...
However, even when stepping into a simple constructor function I end up landed in primordials.js If I put a breakpoint on the line of the constructor call, AND a breakpoint on the first line of the constructor then the debugger successfully loads the first line of the constructor when choosing Step into. However, if I don't explicitly add a breakpoint in the first line of the constructor (which should be the line it steps to) the interpreter seems to hang for 15 seconds and then drops me into primordials.js The code line I am debugging is at https://github.com/cefn/lauf/blob/72ccc8f1c1781d26cf3238b811dcaf98a87ffe4c/modules/lauf-store/src/core/store.ts#L31 |
@cefn please share your log file by adding "trace": true to the launch.json. The location of the log file will be written to the debug console. However know that this is very likely a bug in Node.js or V8 rather than the debugger. |
I tried adding the flag into the jestrunner.debugOptions like...
It had apparently no effect, with the resulting command and full output with no breakpoints being like...
In the context of Jest do I have to specify the debug parameters a different way? Not sure how I can get any launch.json config to be used, which is why I've relied on Jest Runner to make changes to the debugOptions itself. See the section on debugOptions at https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner for how I currently aim to specify them (which I'm certain worked in previous versions). But I'm ready to follow suggestions if this is altogether the wrong way to debug a jest test suite. |
The location should be printed to the Debug Console, it looks like you're looking at the Terminal output |
Brilliant. I found the log at It's attached. If there's a more legitimate way to run tests than through Jest Runner, which ensures the |
It looks like that's using the old debugger (usually controlled by your user setting |
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! |
@connor4312 I'm using
My debugger works, but it only don't skip the said unnecessary js file. Please help, thank you! |
Please share your log file using the instructions posted above |
Thanks for fast reply, @connor4312 |
@connor4312 Any update? |
Also having this issue launch.json
|
You're hitting the referenced bug in V8. We blackbox the pattern |
@connor4312 Yeah, thanks. In my previous comment, I used the default debugger in VSCode. After some research, I found your extension: https://github.com/microsoft/vscode-js-debug/#nightly-extension I did the mentioned step 1-4 now, reopened VSCode, then did a debug again. Still, primordial.js showed. My launch.json is same to what I commented here before. Here is the new log using your extension: |
@connor4312 Hi Connor, any update on my issue? |
I can confirm this is still an (extremely frustrating) issue in the latest VS Code (1.59) - again and again I step out of an async function and land in a wilderness of uncurry, primoridals, async_hooks. I've tried every single variation of skipFiles I could find and VS Code "sometimes" just puts me in node_modules or node_internals. So unproductive I'm thinking of switching to a different IDE. |
As mentioned before this is a bug in V8/Node.js |
Fyi I've implemented "synthetic black boxing" in #1085 to get around the Node bugs |
I am still having this issue. I've tried multiple different variations for "skipFlags", but when debugging async Jest tests I still end up in node_modules/regenerator-runtime/runtime.js and other files. |
🐛 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 functionuncurryThis
. 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.Please put here any steps, code or any information that can help us
reproduce the error on our side so we can fix it:
Step 1
An index.js file with the next code of the screenshot
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 onprimordials.js
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
Developer Tools console
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.
The text was updated successfully, but these errors were encountered: