Skip to content

Commit d603f01

Browse files
fix(prisma): filter node:internal frames from stack trace
Prisma's PrismaPromise defers execution via .then(), so by the time $allOperations fires, the user code is no longer on the call stack. The first non-filtered frame was node:internal/process/task_queues, producing a misleading file tag. Filter node:internal and node:async_hooks frames so the file tag is omitted rather than wrong. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e5b6d5 commit d603f01

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • nodejs/sqlcommenter-nodejs/packages/sqlcommenter-prisma/src

nodejs/sqlcommenter-nodejs/packages/sqlcommenter-prisma/src/path-trace.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ function isValidCaller(line: string): boolean {
66
if (line.includes("node_modules")) {
77
return false;
88
}
9+
if (line.includes("node:internal") || line.includes("node:async_hooks")) {
10+
return false;
11+
}
912
// make sure we don't break our own tests
1013
if (line.includes(`${LIBRARY_NAME}/test/`)) {
1114
return true;

0 commit comments

Comments
 (0)