Clerk Auth
howdy--- i followed this guide: https://github.com/get-convex/convex-nextjs-app-router-demo
and gutted my project to mimic that flow.
Getting a really strange error when I login. I get logged in with clerk but then see this:
GitHub
GitHub - get-convex/convex-nextjs-app-router-demo: Demo showing a N...
Demo showing a Next.js App Router app powered by Convex backend - GitHub - get-convex/convex-nextjs-app-router-demo: Demo showing a Next.js App Router app powered by Convex backend
7 Replies
failure
Uncaught Error: Failed to insert or update a document in table "users" because it does not match the schema: Object is missing the required field
username
. Consider wrapping the field validator in v.optional(...)
if this is expected.
Object: {name: "Parker Rex", numPosts: 0.0, pictureUrl: "https://img.clerk.com/eyJ0eXBlIjoicHJveHkiLCJzcmMiOiJodHRwczovL2xoMy5nb29nbGV1c2VyY29udGVudC5jb20vYS9BQWNIVHRmYnFzbmQ2Mjh3eW5pdTNTQmtTRW9uZ1E2RTl2Q3pjNXRwN19aLXQ4RmhuZVFFPXMxMDAwLWMiLCJzIjoiM1ZWc0xMOVJDaUZweWR1Rlgrc3BiZXdzcFV5SENMY3JBREZlNHRTSjgxbyJ9"}
Validator: v.object({name: v.string(), numPosts: v.float64(), pictureUrl: v.string(), username: v.string()})
at async handler (../../convex/users.ts:27:12)is nickname specific to github?
need that setting on.
yep that was it lol. Case closed. Use Github auth and enable username to match validation.
Glad this was resolved, thanks for writing it up here.