[Convex Ents] Missing inverse edge

Hi got this this error with this code, seems like I missed an inverse edge but I have no clue where and why:


Error fetching POST  https://youthful-caribou-100.convex.cloud/api/prepare_schema 400 Bad Request: Error: Hit an error while evaluating your schema:
Uncaught Error: Missing inverse edge in table "messages" for edge "messages" in table "privateChats"
    at defineEntSchema (../node_modules/.pnpm/convex-ents@0.7.2_convex@1.11.3_@clerk+clerk-react@5.0.4_react-dom@18.3.1_react@18.3.1__react_3e36zvrjeuxn2krcacprafz7ny/node_modules/convex-ents/src/schema.ts:144:12)
    at <anonymous> (../convex/schema.ts:4:28)


const schema = defineEntSchema({
  privateChats: defineEnt({})
    .field("support", v.boolean(), { default: false })
    .edges("users", { to: "users" })
    .edges("messages"),
  users: defineEnt({})
    .field("clerkId", v.string(), { unique: true })
    .field("username", v.string(), { unique: true })
    .field("firstName", v.optional(v.string()))
    .field("lastName", v.optional(v.string()))
    .edges("chats", { to: "privateChats" })
    .edges("messages"),
  messages: defineEnt({})
    .field("content", v.string())
    .edge("privateChats")
    .edge("users"),
});


package.json: https://gist.github.com/FleetAdmiralJakob/a56f4a4f6d03c93b0773dd2dc0fbbbcc
Gist
GitHub Gist: instantly share code, notes, and snippets.
package.json
Was this page helpful?