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)
awesome 😄 i'll defos give that a go. :xatafly:
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
like if i were to build a theme that uses xata as the backend, to have it automatically setup the scheme based on a conf file or script.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
thank you for all your help. 🙏
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
ah cool, let me clear my cache quick and see if that helps.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
not sure why its being interpreted as a get request.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
GET http://localhost:3000/api/sign/up [HTTP/1.1 404 Not Found 6ms]
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
I updated the function, but now get a 404 when i land on the /api/sign/up or /on endpoints.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
ah, thanks for checking! do you run into the same issue using the original post repo? might be that I messed something up while attempting to implement it.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
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
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
I haven't created a repo yet, but he is the full code so far.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
Cannot destructure property 'id' of 'raw' as it is null (following the Astro tut)
i just tested it again and it created the user, session and set the session cookie, but again showing the original error after being redirected to the endpoint.
56 replies
XXata
Created by SmokeyFro on 7/23/2024 in #help
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