value.getTime is not a function

this code in this basic repo https://github.com/quantuminformation/drizzle-sqlite-recurring-events when running pnpm run db:seed gives error
//https://github.com/quantuminformation/drizzle-sqlite-recurring-events/blob/main/db/seed.ts
const events = await db
.insert(schema.event)
.values([
{
name: 'Event 1',
startTime: new Date(2025, 1, 1, 19, 0, 0).getTime(),
endTime: new Date(2025, 1, 1, 20, 0, 0).getTime(),
},
])
.returning()
//https://github.com/quantuminformation/drizzle-sqlite-recurring-events/blob/main/db/seed.ts
const events = await db
.insert(schema.event)
.values([
{
name: 'Event 1',
startTime: new Date(2025, 1, 1, 19, 0, 0).getTime(),
endTime: new Date(2025, 1, 1, 20, 0, 0).getTime(),
},
])
.returning()
TypeError: value.getTime is not a function
at SQLiteTimestamp.mapToDriverValue (/Users/nikos/WebstormProjects/drizzle-sqlite-recurring-events/node_modules/.pnpm/[email protected][email protected]/node_modules/src/sqlite-core/columns/integer.ts:150:22)
TypeError: value.getTime is not a function
at SQLiteTimestamp.mapToDriverValue (/Users/nikos/WebstormProjects/drizzle-sqlite-recurring-events/node_modules/.pnpm/[email protected][email protected]/node_modules/src/sqlite-core/columns/integer.ts:150:22)
you can see that getTime works when debugging in vscode so I don't know where this error originates
GitHub
GitHub - quantuminformation/drizzle-sqlite-recurring-events
Contribute to quantuminformation/drizzle-sqlite-recurring-events development by creating an account on GitHub.
2 Replies
Braveheart
BraveheartOP12mo ago
Braveheart
BraveheartOP12mo ago
removing .getTime() fixed it
Want results from more Discord servers?
Add your server