You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
debugger freeze everytime on specific breakpoints in typescript applications #205226
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.86.1
OS Version: Ubuntu 22.04
In my company projects the debugger stucks sometimes. Now this issue occured on my open source project and hopefully the vscode dev team is able to help, why the debugger is freezing since several months from time to time.
Steps to Reproduce:
Make sure docker and node lts is installed on your machine. On my side it is v20.10.0
checkout the specific tag from the following repository and install the dependencies with: git clone [email protected]:avan2s/prisma-transactions.git && cd prisma-transactions && git checkout v0.1-vscode-hangup && npm i
open vscode from terminal with code --disable-extensions . (it will also crash with plugins, but just to be sure, we have the same state)
toggle auto attach Smart (F1 => Debug: Auto Attach => smart) and then open the vscode terminal
Please collect trace logs using the following instructions:
If you're able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.
I added a launch.json file and configured the trace parameter and started the test with my npm package.json script npm run test:watch2, which allows me to attach with the launch.json: "test:watch2": "node --inspect-brk ./node_modules/.bin/jest -i --verbose --config jest-unit.json --watchAll"
It started the debugger in watch mode, attached with the launch.json, and executed all tests with a. The breakpoint was set and the error was reproduced:
The trace log file with jest watch with jest prompt, where i pressed a to execute all tests and reproduced the issue: vscode-debugadapter-70819bfc.json
And also the trace log file with watchAll in order to prevent the prompt and executing the tests directly - also reproduced the issue: vscode-debugadapter-251a8652.json
I have to mention that the file got bigger until the terminal was closed.
If you want to try out yourself , the created launch.json and the npm run test:watch2 script is available here by checking out the tag with: git checkout v0.2-vscode-hangup-with-launch
This is because the debugger attempts to use the nodejs.util.inspect.custom symbol to represent variables in the Variables view. It looks like this is defined on the _prismaClient, but calling it blocks and crashes the program. You can see this by adding this line inside of createProxyHandlerForFunction:
RangeError: Maximum call stack size exceeded
at enable (node:internal/inspector_async_hook:50:16)
at formatRaw (node:internal/util/inspect:1052:7)
at formatValue (node:internal/util/inspect:840:10)
at formatProperty (node:internal/util/inspect:1945:11)
at formatRaw (node:internal/util/inspect:1054:9)
at formatValue (node:internal/util/inspect:840:10)
at inspect (node:internal/util/inspect:364:10)
at Fe.i.<computed> (/Users/connor/Downloads/prisma-transactions/node_modules/@prisma/client/runtime/library.js:26:8227)
at formatValue (node:internal/util/inspect:805:19)
at formatProperty (node:internal/util/inspect:1945:11)
at formatRaw (node:internal/util/inspect:1054:9)
at formatValue (node:internal/util/inspect:840:10)
at inspect (node:internal/util/inspect:364:10)
at Fe.i.<computed> (/Users/connor/Downloads/prisma-transactions/node_modules/@prisma/client/runtime/library.js:26:8227)
...
Hi Connor Peet (@connor4312),
thx for your investigation and conclusion. This also explained why it only hangs up in debug mode.
(_prismaClient as any)[Symbol.for('nodejs.util.inspect.custom')]();
What would be your recommendation to fix such kind of an error? Just deleting the symbol from the _prismaclient? I never assigned this symbol there manually.
Would be grateful for any explanation, what options I can consider.
Activity
avan2s commentedon Feb 14, 2024
i can also confirm this issue exist for my macOs system: Apple M1 Sonoma 14.2.1 Darwin arm64 23.2.0
vscode version: 1.86.1
Especially frustrating, when you try to figure out hard bugs when it hangs up all the time and the only thing that works are console log statements.
conceto-NKO commentedon Feb 14, 2024
I've successfully replicated the issue on my system as well. Below are the pertinent details of my MacBook Pro setup.
macOS Version: Ventura 13.5 (22G74)
Model Identifier: MacBookPro15,1
Processor: 6-Core Intel Core i7, 2.6 GHz
System Architecture: amd64
Kernel Version: Darwin 22.6.0
VSCode Version: 1.85.1
ripkeanny commentedon Feb 15, 2024
Can be replicated using:
OS Version: Windows 10 Pro Version 22H2
WSL Version: Ubuntu-20.04
VSCode Version: 1.86.1
connor4312 commentedon Feb 15, 2024
/jsDebugLogs
vscodenpa commentedon Feb 15, 2024
Please collect trace logs using the following instructions:
avan2s commentedon Feb 15, 2024
I added a launch.json file and configured the trace parameter and started the test with my npm package.json script
npm run test:watch2, which allows me to attach with thelaunch.json:"test:watch2": "node --inspect-brk ./node_modules/.bin/jest -i --verbose --config jest-unit.json --watchAll"It started the debugger in watch mode, attached with the
launch.json, and executed all tests with a. The breakpoint was set and the error was reproduced:{ "version": "0.2.0", "configurations": [ { "name": "Attach to Jest Tests", "type": "node", "request": "attach", "trace": true, "port": 9229, "restart": true, "skipFiles": ["<node_internals>/**"] } ] }The trace log file with jest watch with jest prompt, where i pressed a to execute all tests and reproduced the issue:
vscode-debugadapter-70819bfc.json
And also the trace log file with watchAll in order to prevent the prompt and executing the tests directly - also reproduced the issue:
vscode-debugadapter-251a8652.json
I have to mention that the file got bigger until the terminal was closed.
If you want to try out yourself , the created
launch.jsonand thenpm run test:watch2script is available here by checking out the tag with:git checkout v0.2-vscode-hangup-with-launchconnor4312 commentedon Feb 16, 2024
Thanks for the logs and the repro.
This is because the debugger attempts to use the
nodejs.util.inspect.customsymbol to represent variables in the Variables view. It looks like this is defined on the_prismaClient, but calling it blocks and crashes the program. You can see this by adding this line inside ofcreateProxyHandlerForFunction:This eventually crashes with:
I didn't debug further than this.
Let me know if you run into other issues.
andreasvh-conceto commentedon Feb 16, 2024
Hi Connor Peet (@connor4312),
thx for your investigation and conclusion. This also explained why it only hangs up in debug mode.
What would be your recommendation to fix such kind of an error? Just deleting the symbol from the _prismaclient? I never assigned this symbol there manually.
Would be grateful for any explanation, what options I can consider.
thx a lot 🙏
connor4312 commentedon Feb 18, 2024
It is defined in the prisma client,
https://github.com/prisma/prisma/blob/794b61e7474cdd7b83fd2fe0144e1dc3230a220c/packages/client/src/runtime/core/compositeProxy/createCompositeProxy.ts#L119-L126
So it is a bug for them to fix.
avan2s commentedon Feb 18, 2024
Thanks a lot, i will raise an issue on their side: prisma/orm#23181
Best regards :)