SmokeyFro
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
i've been building a commenting engine using astro db and was thinking it would be cool to support multiple providers (astro db, xata, etc) and it would be cool to automate the setup process - same with xata based themes.
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
one last question. is it possible to setup a new schema via code? like a template preset i could use as a theme author to help setup a themes back-end - kinda like in the xata.ts, but in reverse?
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
nah, it's all good. it's the nature of coding. glad we were able to determine the root cause. i'm absolutely loving xata, so it's not a biggie if there are some small teething issues. i have a better understanding of the code after the debug sesh.
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
private async getUserFromSessionId(session_id: string): Promise<DatabaseUser | null> {
const theSession = await this.controller.db.session.filter({ id: session_id }).getFirst();
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
i needed to update the getUserFromSessionId function assigning to the session_id to id and now it works. I'm not taken to the login page like you were in the video, but rather redirected to the / and now showing as logged in 😄
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
the signup form is set to:
<form method="post" action="/api/sign/up">
and the endpoint is set to:
export async function POST({ request, redirect, cookies }: APIContext): Promise<Response> {
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
sorry, i meant i signed up using /signup then get redirected to /api/sign/up. looking at the error log, it's saying the get request is 404, but it's been sent and received as a post.
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
i tested the sign in and it gives the same error. I then checked the sessions table and a new entry was added, but none of the entries have a session_id. Could that be causing the issue?
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
i guess maybe it's because the signup form is posting to that endpoint?
<form method="post" action="/api/sign/up">
Seems like it's getting stuck on the error before redirecting to /
56 replies
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
the error is shown after registering (/pages/signup), when i'm redirected to http://localhost:3000/api/sign/up.
56 replies