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
I have recently started running into a tslog issue that causes tslog to crash when you attempt to log an error whose class' constructor has multiple arguments.
My particular case occurs when using blitz with prisma, upgrading prisma to 5.0.0, and then running an invalid query or mutation (e.g. using select: { idd: true } instead of select: { id: true }). It can be reproduced by following blitz's getting started steps, upgrading prisma to v5, and calling such an invalid mutation query/mutation, as I have done in this reproduction repo: https://github.com/justinsmid/blitz-prisma-clientversion-error-reproduction
The issue appears to have been introduced in tslog version 4.7.5, and the listed workaround in the issue mentioned above appears to be to downgrade tslog to 4.7.4, which I would simply do, except it's not my code that's using tslog, it's blitz.
More specifically, this line is the one causing the issue in my case.
Would downgrading tslog to 4.7.4 be an option for you guys, or would you recommend I try and figure out a workaround on my end?
Paste all your error logs here:
TypeError: Cannot destructure property 'clientVersion' of 'undefined' as it is undefined.
at new PrismaClientValidationError (/[REDACTED]/node_modules/@prisma/client-mysql/runtime/library.js:26:2545)
at Logger._cloneError (/[REDACTED]/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/cjs/BaseLogger.js:238:26)
at Logger._recursiveCloneAndMaskValuesOfKeys (/[REDACTED]/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/cjs/BaseLogger.js:183:41)
at /[REDACTED]/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/cjs/BaseLogger.js:157:25
at Array.map (<anonymous>)
at Logger._mask (/{REDACTED]/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/cjs/BaseLogger.js:156:22)
at Logger.log (/{REDACTED]/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/cjs/BaseLogger.js:99:24)
at Logger.error (/{REDACTED]/node_modules/.pnpm/[email protected]/node_modules/tslog/dist/cjs/index.js:29:22)
at /{REDACTED]/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/@blitzjs/rpc/dist/index-server.cjs:326:15
at Generator.throw (<anonymous>)
at rejected (/{REDACTED]/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/@blitzjs/rpc/dist/index-server.cjs:127:29)
What is the problem?
I have recently started running into a tslog issue that causes tslog to crash when you attempt to log an error whose class' constructor has multiple arguments.
My particular case occurs when using blitz with prisma, upgrading prisma to
5.0.0
, and then running an invalid query or mutation (e.g. usingselect: { idd: true }
instead ofselect: { id: true }
). It can be reproduced by following blitz's getting started steps, upgrading prisma to v5, and calling such an invalid mutation query/mutation, as I have done in this reproduction repo: https://github.com/justinsmid/blitz-prisma-clientversion-error-reproductionThe issue appears to have been introduced in tslog version
4.7.5
, and the listed workaround in the issue mentioned above appears to be to downgrade tslog to4.7.4
, which I would simply do, except it's not my code that's using tslog, it's blitz.More specifically, this line is the one causing the issue in my case.
Would downgrading tslog to
4.7.4
be an option for you guys, or would you recommend I try and figure out a workaround on my end?Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
blitz new myAppName
cd myAppName
pnpm install [email protected] @prisma/[email protected]
useQuery
(see snippet above for example)pnpm run dev
Alternatively, go to my reproduction repository where I have already done these steps and follow the README's steps
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: