#InvalidJson: Hit an error while evaluating your schema
5 messages · Page 1 of 1 (latest)
Hi @honest breach. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources, this error typically occurs when there's an issue with your schema validation. There are several common causes for this error:
-
Circular Dependencies: If you have imports going in both directions between files that contain validators, this can cause the error. For example, if you have imports between
profile/validators.tsandsubmission/validators.tsas mentioned in this discussion. -
Invalid Validators: You might have an invalid validator in your schema, args, or returns. For example, using something like
v.object({ field: "foo" })instead ofv.object({ field: v.literal("foo") })as noted in this thread. -
Importing Validators: There can be issues when importing validators from other files. As one user found, keeping shared validators as plain objects and spreading them worked better than directly importing validator objects from this discussion.
-
Multiple Versions: Sometimes this happens if there are multiple versions of Convex in your project (like when using
convex-helpers). Updating all Convex-related node modules might help as suggested here.
To troubleshoot:
- Check for circular imports in your validator files
- Verify all your validators are properly defined
- Try removing tables/fields one at a time to isolate the issue
- Make sure you're not using unsupported functions like
Math.randomorDatein your schema
Unfortunately, the error message isn't very specific about which validator is causing the problem, making it harder to debug.
Let me know if you need help with a specific part of your schema!
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@honest breach Kapa.ai is still learning and improving, please let me know how I did by reacting below.