Tony
Tony
Explore posts from servers
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
I appreciate your help on it also
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Yeah, pretty clear there haha. On the upside, having a reliable server error for so long let me perfect my front end's error handling so I'll take that
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Guess that does make sense, lol. Strange it caused no problems on my other project but I'll keep that in mind for the future
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Yeah, uhh... it seems using one global one fixed it, insert just worked fine
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Not really, might quickly change that
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
I do const db = drizzle(...) in every file I use the db, do I have to throw logger on all of them or just the one in the index file?
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Yup I can
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Well this is the insert code
const session: typeof sessionsTable.$inferInsert = {
id,
accountId,
createdAt: new Date(),
expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30)
};

try {
await db.insert(sessionsTable).values(session);
} catch(err) {
console.error(err);
}
const session: typeof sessionsTable.$inferInsert = {
id,
accountId,
createdAt: new Date(),
expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30)
};

try {
await db.insert(sessionsTable).values(session);
} catch(err) {
console.error(err);
}
id is a string, made from encoding the session token which is some crypto stuff accountId being the cuid2 string that's on the account (the test account i'm using has an ID of ss7f96cyakd6dy6k9y1idbhp for example) And createdAt/expiresAt are self explanatory
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Same error 🙃
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
No description
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Yeah I could, and just remove the account reference maybe?
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Yep, that's exactly what it's coming from. Commenting it out and everything works fine, i've got it in a try catch and it's absolutely where the error is coming from
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
It's strange cause my previous project's code worked even without the primary key, i'm very confused about it
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Studio lets me insert but same error from the orm
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Yeah haha. But yep, I did that, and same issue
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
However the actual error still occurs in the ORM
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
No description
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
No description
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Alright, I'm out at the moment but I'll give it a shot as soon as I'm back
48 replies
DTDrizzle Team
Created by Tony on 1/14/2025 in #help
Error: undefined is not an object
Don't think I actually have drizzle studio, I'll look into it
48 replies