SOLVED: User error (Was: Strange PROD behavior with validation)
I am seeing some strange behavior in my prod environment:
But the schema is this:
How can this be?
The screenshots are attached to show that the server environment has indeed picked up that the persona_id is optional.
Also, the error message in chrome looks different than usual when there is a validation error. And the same code works in dev. The error usually includes the validation error in the Chrome-log. Also, this same code works in the dev-environment.
The request: f82d394c049b7717
9 Replies
This likely comes down to expected code not being deployed. If you run
npx convex deploy
with your latest code, you also want to make sure the deploy succeeds. It will often fail with schema changes due to incompatible existing documents.But if the schema didn't match it, would it not be reflected in the function call in the portal?
The error message difference you're observing is because dev pushes your errors to the client, but prod only pushes errors made with
ConvexError
to avoid security issues from unintended leaks in error messges.
If you run npx convex deploy
, what output do you getThe error is because null is a value, while undefined means the field doesn't exist at all (i.e. is undefined)
Ah the default args in the dashboard exclude optionals
OK, that makes sense. I will look at it. Thanks so much for the quick response!
I would think I would have run into that issue about 1000 times previously.
nulls in js are the worst lol
Yeah, but I really should have this stuff down by now. š Thanks so much, I am pretty sure I can find this in no time.
Thanks, now it works!