Error With types from Drizzle

Since i upgraded to latest version of drizzle i am not getting any types and alot of errors. Example:
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'
drizzle-orm: "0.36.3" drizzle-kit: "0.28.1" Introspected the schema and relation files from db. example:
export const users = pgTable(
'users',
{
archived: boolean().default(false).notNull(),
externalId: text('external_id').notNull(),
id: uuid()
.default(sql`uuid_generate_v4()`)
.primaryKey()
.notNull(),
language: language().notNull(),
name: text().notNull(),
type: userType().notNull(),
updatedAt: timestamp('updated_at', { mode: 'string' }),
},
(table) => {
return {
uqExternalId: unique('uq_external_id').on(table.externalId),
usersExternalIdKey: unique('users_external_id_key').on(table.externalId),
}
},
)
export const users = pgTable(
'users',
{
archived: boolean().default(false).notNull(),
externalId: text('external_id').notNull(),
id: uuid()
.default(sql`uuid_generate_v4()`)
.primaryKey()
.notNull(),
language: language().notNull(),
name: text().notNull(),
type: userType().notNull(),
updatedAt: timestamp('updated_at', { mode: 'string' }),
},
(table) => {
return {
uqExternalId: unique('uq_external_id').on(table.externalId),
usersExternalIdKey: unique('users_external_id_key').on(table.externalId),
}
},
)
What could be going wrong? Can anyone help?
2 Replies
Xpecial Poo
Xpecial PooOP4w ago
Hello, anyone? i havent found a solution yet
Angelelz
Angelelz4w ago
If you are in a monorepo, all your projects have to have the same drizzle and drizzle-kit versions Reinstall all packages. A good idea would be to delete node_modules and run npm install afterwards
Want results from more Discord servers?
Add your server