P
Prisma6mo ago
mr nooli

Error: Missing data field (Value): 'created_at'; node:

After trying to use the new prisma query compiler - works with the standard rust engines, just not with the new query compiler.
6 Replies
Prisma AI Help
Prisma AI Help6mo ago
You've gone full bot mode! Let me fetch that AI answer for you ASAP. The error "Missing data field (Value): 'created_at'" when using the new Prisma query compiler (but not with the standard Rust engines) suggests that the field created_at is required in your model, but is not being provided in your create or upsert operation. From the knowledge sources, this type of error commonly occurs when: - The Prisma schema defines created_at as a required field (not nullable), often with @default(now()). - The Prisma Client expects you to provide a value for created_at, or for the database to supply a default. - If you explicitly set created_at: null, Prisma will not use the default; instead, it will try to set the field to null, which fails for non-nullable fields. You should use undefined or simply omit the field to trigger the default behavior. See the explanation on null vs undefined: "In Prisma, created_at: null does not mean 'set created_at to its default value', it means 'set created_at to null'. Since it is not nullable... you get a validation error. If you want to set it to default value, use undefined instead" Discussion on null vs undefined. Additionally, some recent changes or regressions in Prisma versions have caused default values not to be applied as expected, especially with time-based fields and composite primary keys. This has been reported in several issues, and sometimes downgrading to a previous version resolves the problem PrismaClientUnknownRequestError on create statement default optional value. What to do: - Ensure you are not passing created_at: null. - Omit created_at from your data object, or set it to undefined, so Prisma can apply the default. - If the issue persists only with the new query compiler, it may be a bug or an incompatibility. In that case, consider reporting it to the Prisma team with a minimal reproduction. If you need to explicitly set created_at, do so with a valid Date value:
data
: {
// ...other fields,
created_at: new Date(),
}
data
: {
// ...other fields,
created_at: new Date(),
}
If you want the default, omit it:
data: {
// ...other fields
}
data: {
// ...other fields
}
If you need more details, please provide your schema and the exact query. 🤔 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.
lil rocket .30
lil rocket .306mo ago
mange to find a fix?
mr nooli
mr nooliOP6mo ago
No dice. “EA” -> “preview” supposedly no major bugs. I’m just staying on Prisma 6.3 until the query compiler is a bit more stable.
Nurul
Nurul6mo ago
It seems that you are running into this issue: https://github.com/prisma/prisma/issues/27359
GitHub
Query compiler + Driver adapter causing "Missing data field (Value)...
Bug description Any fields in my schema that are bigints being queried, or included in a query results in an error. I'm not sure if it's my stack but I'm using Nuxt3 with prisma in a wo...
Nurul
Nurul6mo ago
It should be hopefully fixed in 6.10.0
mr nooli
mr nooliOP6mo ago
any timeline on the 6.10.0

Did you find this page helpful?