Prisma 6.6.0: Unable to use Prisma.JsonNull and Prisma.DbNull due to "We could not serialize [object
I have hit a problem that is affecting both dev and prod... on a Friday night.
Any help on the GH issue would be helpful: https://github.com/prisma/prisma/issues/26987
GitHub
Prisma 6.6.0: Unable to use Prisma.JsonNull and Prisma.DbNull due t...
Bug description After updating to Prisma 6.6.0 i have been facing this issue. Severity ⚠️ Major: Breaks core functionality (e.g., migrations fail) Reproduction Create schema with optional Json fiel...
3 Replies
You chose to compile with the bot. One moment while I piece together your answer…
I can see you're having issues with Prisma 6.6.0 related to
Prisma.JsonNull
and Prisma.DbNull
. Based on the knowledge sources, this appears to be a known issue in Prisma 6.6.0 with the new generator.
The issue is related to type checking failures with the client generated by the new generator. Specifically, there are errors with the DbNull
, JsonNull
, and AnyNull
properties in the generated client:
This is happening because the generated client contains code that violates TypeScript constraints, particularly when using "composite": true
in your tsconfig.json.
A temporary workaround that has been suggested is to create a script that modifies the generated client after Prisma generates it:
Then add this to your package.json:
This issue has been reported in GitHub issue #26841 and GitHub issue #26902.
Another simpler but less ideal workaround is to add @ts-nocheck
at the top of the client.ts
file, though this would need to be done after each file generation.
I hope this helps with your Friday night emergency!
GitHub: prisma/prisma
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.Hey!
Does this error occur on Prisma version 6.5.0 as well?
No, it startted to happen once I have updated from 6.5 to 6.6
So it seems to be 6.6 issue
@Nurul (Prisma) instead of JsonNull/DbNull can i just use
null
for the time while you fix this in the next relese?
@Nurul any update?