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
When creating a table with a null variable, it's possible to pass an undefined value to the patch function without TypeScript raising an error — even though this will crash at runtime.
just convex run simple:nipunntest
✖ Failed to run function "simple:nipunntest":
Error: [Request ID: b6e6f4f5179064a9] Server Error
Uncaught Error: Failed to insert or update a document in table "test" because it does not match the schema: Object is missing the required field `nullVariable`. Consider wrapping the field validator in `v.optional(...)` if this is expected.
Object: {}
Validator: v.object({nullVariable: v.union(v.null(), v.string()), undefinedVariable: v.optional(v.string())})
at async handler (../convex/simple.ts:36:27)
so having it fail at compile time seems like a benefit.
When creating a table with a
null
variable, it's possible to pass anundefined
value to thepatch
function without TypeScript raising an error — even though this will crash at runtime.Expected behavior: TypeScript should warn that
undefined
is not a valid value fornullVariable
.The text was updated successfully, but these errors were encountered: