#amy_code

1 messages ยท Page 1 of 1 (latest)

eager spokeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1351491679474946088

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

ripe harbor
#

Hi!!

#

nice to chat again i think we talked last tim

#

time

vapid bay
#

What's the actual error you see?

ripe harbor
#

Webhook received: POST /api/webhook
Raw body received, length: 3036 bytes
โœ… Stripe signature verified for event: checkout.session.expired, id: evt_1R3thACLoBz9jXRljxumawj4
Error processing webhook: TypeError: Cannot read properties of undefined (reading 'length')
at initializeFirebaseDirectly (/vercel/path0/api/webhook.ts:12:43)
at handler (/vercel/path0/api/webhook.ts:153:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Server.<anonymous> (/opt/rust/nodejs.js:2:11025)
at async Server.<anonymous> (/opt/rust/nodejs.js:16:5674)

vapid bay
#

Unclear how that is related to addig text to a Checkout page?

#

WHat are you trying to do that throws that error?

ripe harbor
#

im trying to check out

vapid bay
#

I mean, the actual code/API request that throws that error

ripe harbor
#

so i have 2 types of models

#

simple 3d models and complex ones

#

checkout works for simple

#

doesnt work for complex (bigger file)

#

that smy hypothesis

vapid bay
#

OK, but that means nothing to me unfortunately. Can you share the code that you run that throws this error: TypeError: Cannot read properties of undefined (reading 'length')

I guess it's on this file/line: api/webhook.ts:12:43

ripe harbor
#

oh yes thanks

vapid bay
#

I'd guess it's this line then:

  if (!firebaseInitialized && !admin.apps.length) {
#

So admin.apps is nullish, and can't check the length of it. Maybe add a chaining operator to conditionally check it exists before you check the length:

  if (!firebaseInitialized && !admin?.apps?.length) {
eager spokeBOT
ripe harbor
#

hmmm ok