T3 App type error
Hi guys, I just tried creating a new t3 app and I selected next-auth and drizzle. How can I fix this type error? TIA
Type 'PgTableWithColumns<{ name: "user"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, {}, {}>; name: PgColumn<...>; email: PgColumn<...>; ...' is not assignable to type 'DefaultPostgresUsersTable'.
Type 'PgTableWithColumns<{ name: "user"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, {}, {}>; name: PgColumn<...>; email: PgColumn<...>; ...' is not assignable to type 'PgTable<{ name: string; columns: { id: DefaultPostgresColumn<{ columnType: "PgVarchar" | "PgText" | "PgUUID"; isPrimaryKey: true; data: string; notNull: true; dataType: "string"; }>; name: DefaultPostgresColumn<...>; email: DefaultPostgresColumn<...>; emailVerified: DefaultPostgresColumn<...>; image: DefaultPostgres...'.
The types of '_.config.columns.id' are incompatible between these types.
Type 'PgColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; }, {}, {}>' is not assignable to type 'DefaultPostgresColumn<{ columnType: "PgVarchar" | "PgText" | "PgUUID"; isPrimaryKey: true; data: string; notNull: true; dataType: "string"; }>'.
Solution:Jump to solution
nah, wans't really referring to t3 hahahaa. Its just an expression out of frustration. I did some research and I think my problem isn't caused by t3 at all, its because of the adapter just not having the right type.
18 Replies
How did you create the tables? Did you choose the right PG lib from Drizzle for creating tables?
Even I'm facing the same error. Used the exact adapter that is given in next auth documentation. By the way I did not even edit anything from the scaffolded code
Idk if you are using the t3 template... If not, if you set it up through the CLI you will see a working solution
I set it with the CLI and nothing more
I think this is the same error I’m having as well
haven't touched anything, its the default t3 app with next auth and drizzle
I did use it
same dude, I have no idea how to fix it
I created the secret key, from the command it gives about the db url, it took other errors away. But still don’t login using discord
how did you do that?
have you added the client id and secret id?
I mean, how do you even use next auth properly? the setup in t3 app is different compared to what I'm used to.. the NextAuth is returning any, how do I get the handlers, signIn, signOut, etc.?
Can someone please teach me
The T3app command, has a command for the db to run in the terminal, it creates a key to paste in
are you talking about the
npx auth secret
?The tables are declared like this
but even when I change it to pgTable, the error doesn't go away
Yes
Mine is erroring that “user” isn’t found
This sucks dude haahahha
T3? I’ve pretty much abandoned it
Solution
nah, wans't really referring to t3 hahahaa. Its just an expression out of frustration. I did some research and I think my problem isn't caused by t3 at all, its because of the adapter just not having the right type.
GitHub
Drizzle Adapter Postgres Broken – The types of _.config.columns.id ...
Adapter type @auth/drizzle-adapter Environment System: OS: macOS 14.5 CPU: (12) arm64 Apple M2 Max Memory: 3.54 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.17.1 - ~/.nvm/versions/node/v1...
So I'm finding myself caught up in this I tried implementing the roll back as a fix but I'm still getting the error....