-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
VS Code debugger freeze from time to time, when Prisma Client is involved #23181
Comments
Hi @janpio tried it again with the new version. Is fixed now, we can debug again - thanks! |
For me the freeze always happens if I try to break (stop the debugger) at that execute inside a transaction.
|
I'm experiencing the same issue only when inside a transaction. Have you found a fix? I've updated @prisma/client package to 5.19.0 but still have the issue. |
Bug description
Since several month my debugger in vscode hangs up in specific lines of codes in several projects related to prisma. I am not the only one. First i thought it is a vscode issue. So i raised an issue on microsoft vscode repo. It came out, that prisma client is causing this issue by causing a maximum call stack size exceeded error (see here)
The microsoft support team idendified the issue in the following lines in prisma
Prisma defines the
const customInspect = Symbol.for('nodejs.util.inspect.custom')
and vscode (and i think also other IDEs) use these for watching variables. With that knowledge i also created another repository to reproduce the deep issue. There is also a inital repo, i provided to microsoft, where you can debug (see how to reproduce section). The debugger freeze and you can not go to the next step anymore. Onlyconsole.log
statements help. Hard bugs are nearly impossible to fix or take to much time.I would appreciate if the prisma team can fix this issue as soon as possible. Otherwise developers are unable to debug any related prisma code (especially in prisma interactive transactions these occurs more often or if you created a simple extended client) in specific scenarios.
How to reproduce
In general calling
Symbol.for('nodejs.util.inspect.custom')
function from prisma is causing the issue and leads to infinite call stack.You have 2 options:
Option 1: Go to the initial microsoft issue. There is a real life project, where you can reproduce the hang up by debugging like in usual node projects: microsoft/vscode#205226 (comment) and follow the reproducing steps.
Option 2: The more deep reproducing issue, which is the inital cause of the problem. It simulates watching variables in vscode debugger:
git clone [email protected]:avan2s/prisma-vscode-debugger-hangup.git && cd prisma-vscode-debugger-hangup && npm i && npm run test
RangeError: Maximum call stack size exceeded
Expected behavior
The debugger from vscode and other ides is not hanging up. Maybe removing the symbol
Symbol.for('nodejs.util.inspect.custom')
from the client will already fix the issue. But prisma team have to decide.Prisma information
any schema will reproduce the issue. I would recommend checking out the tag from
how to reproduce
. In my case it is:vitest test code for reproducting the issue:
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: