DT
Drizzle Team•7mo ago
hk

Cannot read properties of undefined (reading 'compositePrimaryKeys')

My table
export const tableName = pgTable(
'table_name',
{
t1Id: varchar('t1_id', { length: 255 })
.notNull()
.references(() => t1.id),
t2Id: varchar('t2_id', { length: 255 })
.notNull()
.references(() => t2.id),
...defaults,
},
(table) => {
return {
pk: primaryKey({
columns: [table.t1Id, table.t2Id],
}),
};
},
);
export const tableName = pgTable(
'table_name',
{
t1Id: varchar('t1_id', { length: 255 })
.notNull()
.references(() => t1.id),
t2Id: varchar('t2_id', { length: 255 })
.notNull()
.references(() => t2.id),
...defaults,
},
(table) => {
return {
pk: primaryKey({
columns: [table.t1Id, table.t2Id],
}),
};
},
);
2 Replies
hk
hkOP•7mo ago
Error
TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')
at /node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:19323:67
at Array.map (<anonymous>)
at prepareAddCompositePrimaryKeyPg (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:19315:33)
at applyPgSnapshotsDiff (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:19825:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async preparePgPush (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:22080:52)
at async pgPush (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:106652:26)
at async Command.<anonymous> (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:113633:7)
TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')
at /node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:19323:67
at Array.map (<anonymous>)
at prepareAddCompositePrimaryKeyPg (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:19315:33)
at applyPgSnapshotsDiff (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:19825:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async preparePgPush (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:22080:52)
at async pgPush (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:106652:26)
at async Command.<anonymous> (/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:113633:7)
I got this error only after upgrading to [email protected] and 0.21.2 anything I can do about it? thanks @terlan8892 downgraded for now until we get an update from drizzle 😅 just the kit to 0.20.18 and if you want to use drizzle studio run studio--port 4983
rphlmr âš¡
rphlmr ⚡•7mo ago
Hey 👋 can you open an issue on GitHub for that? The team is hardly working on fixes
Want results from more Discord servers?
Add your server