SmokeyFro
SmokeyFro
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
Howdy folks. I'm pretty new to Xata and have to say so far it's pretty dang awesome. I'm still figuring things out and have been going through the Astro, Xata, Stripe & Lucia tut (sans the stripe part). The user registration and session parts are working, but I'm getting the following error when signing up as a new user: "Cannot destructure property 'id' of 'raw' as it is null.". Checking the code I see its referring to line 22 of the transformIntoDatabaseSession function in the lucia/xata.ts:
function transformIntoDatabaseSession(raw: SessionSchema): DatabaseSession {
const { id, user_id: userId, expires_at: expiresAt, ...attributes } = raw;
return {
id,
userId,
expiresAt,
attributes
};
}
function transformIntoDatabaseSession(raw: SessionSchema): DatabaseSession {
const { id, user_id: userId, expires_at: expiresAt, ...attributes } = raw;
return {
id,
userId,
expiresAt,
attributes
};
}
Looking in the db and I can see the id is there, so not sure how to get around the error. Anyone have any ideas of what I'm missing?
56 replies