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"; }>'.
No description
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.
Jump to solution
18 Replies
JulieCezar
JulieCezar5mo ago
How did you create the tables? Did you choose the right PG lib from Drizzle for creating tables?
Sidarth
Sidarth5mo ago
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
JulieCezar
JulieCezar5mo ago
Idk if you are using the t3 template... If not, if you set it up through the CLI you will see a working solution
Sidarth
Sidarth5mo ago
I set it with the CLI and nothing more
JustCodeItAll
JustCodeItAll5mo ago
I think this is the same error I’m having as well
Salumsu
SalumsuOP5mo ago
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
JustCodeItAll
JustCodeItAll5mo ago
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
Salumsu
SalumsuOP5mo ago
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
JustCodeItAll
JustCodeItAll5mo ago
The T3app command, has a command for the db to run in the terminal, it creates a key to paste in
Salumsu
SalumsuOP5mo ago
are you talking about the npx auth secret?
Salumsu
SalumsuOP5mo ago
The tables are declared like this
No description
No description
Salumsu
SalumsuOP5mo ago
but even when I change it to pgTable, the error doesn't go away
No description
JustCodeItAll
JustCodeItAll5mo ago
Yes Mine is erroring that “user” isn’t found
Salumsu
SalumsuOP5mo ago
This sucks dude haahahha
JustCodeItAll
JustCodeItAll5mo ago
T3? I’ve pretty much abandoned it
Solution
Salumsu
Salumsu5mo ago
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.
Salumsu
SalumsuOP5mo ago
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...
bloo
bloo4mo ago
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....
Want results from more Discord servers?
Add your server