TypeScript errors with new `prisma-client` generated client

Hello people! I have a small question: I tried to update a small project to use the new generated client feature. It runs fine and it all works as it should, but when I run tsc -b to perform type checking, it fails with
app/generated/prisma/client/client.ts:341:16 - error TS4094: Property '_brand_DbNull' of exported anonymous class type may not be private or protected. 341 export const DbNull = runtime.objectEnumValues.instances.DbNull ~~ app/generated/prisma/client/client.ts:341:16 341 export const DbNull = runtime.objectEnumValues.instances.DbNull ~~ Add a type annotation to the variable DbNull. app/generated/prisma/client/client.ts:348:16 - error TS4094: Property '_brand_JsonNull' of exported anonymous class type may not be private or protected. 348 export const JsonNull = runtime.objectEnumValues.instances.JsonNull ~~ app/generated/prisma/client/client.ts:348:16 348 export const JsonNull = runtime.objectEnumValues.instances.JsonNull ~~ Add a type annotation to the variable JsonNull. app/generated/prisma/client/client.ts:355:16 - error TS4094: Property '_brand_AnyNull' of exported anonymous class type may not be private or protected. 355 export const AnyNull = runtime.objectEnumValues.instances.AnyNull ~ app/generated/prisma/client/client.ts:355:16 355 export const AnyNull = runtime.objectEnumValues.instances.AnyNull ~ Add a type annotation to the variable AnyNull. Found 3 errors.
I'm not quite sure how to resolve this. Does anyone have a suggestion? I made a public reproduction: https://github.com/jensmeindertsma/fuel/pull/6 feel free to clone this branch and run pnpm install && pnpm typecheck to see the issue. Thanks so much in advance!
GitHub
Upgrade Prisma by jensmeindertsma · Pull Request #6 · jensmeinder...
I tried to upgrade Prisma to use the new generated client feature. I ran into some issues with TypeScript type checking: ❯ pnpm typecheck > @jensmeindertsma/fuel@ typecheck /home/jens/deve...
3 Replies
Prisma AI Help
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul3w ago
Just to confirm, if you ran tsc -b command with Prisma version 6.5.0, it was working fine?
juniperxxd
juniperxxdOP3w ago
Yes, this was working fine. With version 6.5.0 I was using the non-generated client, if I try using 6.5.0 while also setting output ( also switch back to prisma-client-js) I ran into the weird problem that the whole client was being printed to the terminal, causing my terminal emulator to quickly run out of memory This looks something like this:
i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};A.toSignificantDigits=A.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ie(e,1,Me),t===void 0?t=n.rounding:ie(t,0,8)),I(new n(r),e,t)};A.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};A.truncated=A.trunc=function(){return I(new this.constructor(this),this.e+1,1)};A.valueOf=A.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=O-n.length,r&&(o+=Ie(r)),o+=n;s=e[t],n=s+"",r=O-n.length,r&&(o+=Ie(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function ie(e,t,r){if(e!==~~e||e<t||e>r)throw Error(De+e)}function St(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=O,i=0):(i=Math.ceil((t+1)/O),t%=O),o=H(10,O-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function wr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=vn.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Dl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Cr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=rt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var V=function(){function e(n,i,o){var s,a=0,l=n.l^C%
i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};A.toSignificantDigits=A.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ie(e,1,Me),t===void 0?t=n.rounding:ie(t,0,8)),I(new n(r),e,t)};A.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};A.truncated=A.trunc=function(){return I(new this.constructor(this),this.e+1,1)};A.valueOf=A.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=O-n.length,r&&(o+=Ie(r)),o+=n;s=e[t],n=s+"",r=O-n.length,r&&(o+=Ie(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function ie(e,t,r){if(e!==~~e||e<t||e>r)throw Error(De+e)}function St(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=O,i=0):(i=Math.ceil((t+1)/O),t%=O),o=H(10,O-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function wr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=vn.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Dl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Cr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=rt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var V=function(){function e(n,i,o){var s,a=0,l=n.l^C%
times 100000000 in length It looks as it the Prisma Client contains some invalid typescript code If I can do anything to help debug this further please let me know 😊

Did you find this page helpful?