Papa Johns
Papa Johns4mo ago

```

Validator<Record<string, any>, "required", any>): TableDefinition<Validator<Record<string, any>, "required", any>, {}, {}, {}>', gave the following error.
Object literal may only specify known properties, and 'firstName' does not exist in type 'Validator<Record<string, any>, "required", any>'.
Validator<Record<string, any>, "required", any>): TableDefinition<Validator<Record<string, any>, "required", any>, {}, {}, {}>', gave the following error.
Object literal may only specify known properties, and 'firstName' does not exist in type 'Validator<Record<string, any>, "required", any>'.
I am trying to use the firstName and lastname in my schema. But it is not allowing me to do so.
7 Replies
Hmza
Hmza4mo ago
Looks like your schema syntax might be a bit off. as I don't know more about your schema. can you confirm it follows this pattern
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

export default defineSchema({
users: defineTable({
firstName: v.string(),
lastName: v.string(),
//more fields
}),
//more tables
});
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

export default defineSchema({
users: defineTable({
firstName: v.string(),
lastName: v.string(),
//more fields
}),
//more tables
});
Papa Johns
Papa JohnsOP4mo ago
yes similar to that with some more utility related fields If I mention the tokenIdentifier field, it doesn't throw this error. I am trying to integerate Clerk and convex
Hmza
Hmza4mo ago
I see so its auth related! Are you defining custom table for auth users? You should check this repo out and see how convex schema and functions are defined https://www.convex.dev/templates/nextjs-app-router
Next.js 14 App Router
This example app showcases Convex backend powering a Next.js app.
Hmza
Hmza4mo ago
I think you’ll need that for JWT
Papa Johns
Papa JohnsOP4mo ago
Actually I am redefining the users table for my clerk authentication with some extra fields based on the clerk configuration. what is the syntax for optional Fields I was using v.string().isOptional and that was issue here.
jamwt
jamwt4mo ago
v.optional(v.string())
Papa Johns
Papa JohnsOP4mo ago
thanks for the reply.

Did you find this page helpful?