Hey there kind of cross posting this as

Hey there, kind of cross-posting this as I posted this already in #next-on-pages. Yet I am unsure if this is actually a D1 or Pages / Next issue. We encouter the following error on a deployed app only. No issues locally with Wrangler (3.5.0) and the same app code:
"Error: D1_TYPE_ERROR: Type 'object' not supported for value 'Tue Sep 26 2023 12:48:07 GMT+0000 (Coordinated Universal Time)'
at D1PreparedStatement.bind (bundledWorker-0.17018918700489616.mjs:898:17)
at s.executeQuery (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:12:44988)
at __next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:48052
at Ii.provideConnection (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:83082)
at async at.executeQuery (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:47999)
at async _e.execute (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:19677)
at async _e.executeTakeFirst (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:19900)
at async _e.executeTakeFirstOrThrow (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:19972)
at async createSession (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:91101)
at async Ue.<computed> (__next-on-pages-dist__/webpack/71992532242772f20ff0087800cdd46e.js:56:78937)"
"Error: D1_TYPE_ERROR: Type 'object' not supported for value 'Tue Sep 26 2023 12:48:07 GMT+0000 (Coordinated Universal Time)'
at D1PreparedStatement.bind (bundledWorker-0.17018918700489616.mjs:898:17)
at s.executeQuery (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:12:44988)
at __next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:48052
at Ii.provideConnection (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:83082)
at async at.executeQuery (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:47999)
at async _e.execute (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:19677)
at async _e.executeTakeFirst (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:19900)
at async _e.executeTakeFirstOrThrow (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:19972)
at async createSession (__next-on-pages-dist__/webpack/9b3bdf9eee839442fe37ed586efaff1d.js:1:91101)
at async Ue.<computed> (__next-on-pages-dist__/webpack/71992532242772f20ff0087800cdd46e.js:56:78937)"
SQL Schema
CREATE TABLE "Session"
(
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
"sessionToken" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"expires" DATETIME NOT NULL,
FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
CREATE TABLE "Session"
(
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
"sessionToken" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"expires" DATETIME NOT NULL,
FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
DB Type for Kysely (with D1Dialect)
export interface Database {
...
Session: {
id: GeneratedAlways<string>
userId: string
sessionToken: string
expires: string
};
...
}
export interface Database {
...
Session: {
id: GeneratedAlways<string>
userId: string
sessionToken: string
expires: string
};
...
}
Any obvious fails on our end?
1 Reply
JThiel
JThielOP•17mo ago
For reference: Not a D1 issue, but indeed a Kysely / D1Dialect issue. We open an issue there 🙂
Want results from more Discord servers?
Add your server